Permlink Replies: 34 - Pages: 3 [ Previous | 1 2 3 ] - Last Post: 15 Jan 25, 22:53 Last Post By: davidekholm Threads: [ Previous | Next ]
davidekholm

Posts: 3,603
Registered: 18-Oct-2002
Re: Rewritten image tools
Posted: 15 Jan 25, 00:42   in response to: MarkusD in response to: MarkusD
  Click to reply to this thread Reply
I noticed that the Levels filter (brightness and contrast) wasn't that performant at all - even slower than the old implementation. I've now reimplemented it again, this time using fast lookup-tables (Java2D LookupOp) . Now it's many times faster than before.
Here's data from rebuilding 94 sample JPEGs Rob passed me. I applied brightness, contrast and gamma on them:

jAlbum 36.1 with old filters:
         FileFilters.loadImage:    94 calls      5,337s
         FileFilters.saveImage:   282 calls       5,13s
    HardwareSmoothScaler.scale:   276 calls      4,817s
      AlbumBean.processFilters:   470 calls      3,313s
   FileFilters.unifyColorModel:    94 calls      2,262s

jAlbum 36.1.5 with new filters:
HardwareSmoothScaler.scale:   276 calls      2,485s
     FileFilters.loadImage:    94 calls      1,958s
     FileFilters.saveImage:   282 calls      1,827s
  AlbumBean.processFilters:   470 calls      1,541s
             Levels filter:    94 calls      0,439s
              Gamma filter:    94 calls      0,428


This version of "Levels" filter is around 10x faster than the previous beta version.

To try it out, just grab https://jalbum.net/download/JalbumFilters.jaext and put in inside jAlbum's "ext" folder.
RobM

Posts: 3,963
Registered: 4-Aug-2006
Re: Rewritten image tools
Posted: 15 Jan 25, 21:03   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:
I noticed that the Levels filter (brightness and contrast) wasn't that performant at all - even slower than the old implementation. I've now reimplemented it again, this time using fast lookup-tables (Java2D LookupOp) . Now it's many times faster than before.
Here's data from rebuilding 94 sample JPEGs Rob passed me. I applied brightness, contrast and gamma on them:

jAlbum 36.1 with old filters:

         FileFilters.loadImage:    94 calls      5,337s
         FileFilters.saveImage:   282 calls       5,13s
    HardwareSmoothScaler.scale:   276 calls      4,817s
      AlbumBean.processFilters:   470 calls      3,313s
   FileFilters.unifyColorModel:    94 calls      2,262s

jAlbum 36.1.5 with new filters:
HardwareSmoothScaler.scale:   276 calls      2,485s
     FileFilters.loadImage:    94 calls      1,958s
     FileFilters.saveImage:   282 calls      1,827s
  AlbumBean.processFilters:   470 calls      1,541s
             Levels filter:    94 calls      0,439s
              Gamma filter:    94 calls      0,428

This version of "Levels" filter is around 10x faster than the previous beta version.

To try it out, just grab https://jalbum.net/download/JalbumFilters.jaext and put in inside

Same project and repeating your effects
jAlbum's "ext" folder.
Old Filter 15.41s
New Filter 14.656s

Odd that I still don't see a significant difference.

David, can you remind me of the way to get the calls and timings of the different processes?
I remember to get the calls you use Profiler.instance.forSample("FileFilters.loadImage").traceCalls = true

But I don't know how to get the elapsed time, is it a different API call?
RobM

Posts: 3,963
Registered: 4-Aug-2006
Re: Rewritten image tools
Posted: 15 Jan 25, 21:31   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
For a minute I thought I'd found out my error. At some point I had set the number of cores to 1. Increased it back to 8 and the times are faster but the difference is still not much.
OlD Filter = 6.072s
New Filter = 5.736s
davidekholm

Posts: 3,603
Registered: 18-Oct-2002
Re: Rewritten image tools
Posted: 15 Jan 25, 22:52   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Rob, are you sure you don't perhaps have an older version of JalbumFilters.jaext lurking under <config>/ext ? That would explain why the better speed isn't kicking in?

With the new tools, you can issue Profiler.instance after an album build and it will print "Levels filter" and "Gamma filter" and the timings. The earlier filters didn't print such detailed timing info.
davidekholm

Posts: 3,603
Registered: 18-Oct-2002
Re: Rewritten image tools
Posted: 15 Jan 25, 22:53   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
jAlbum 37b1 has been released, so we can continue in that thread. All at https://jalbum.net/forum/thread.jspa?threadID=60105&tstart=0
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums