rkalla / imgscalr

Simple Java image-scaling library implementing Chris Campbell's incremental scaling algorithm as well as Java2D's "best-practices" image-scaling techniques.
Apache License 2.0
1.23k stars 243 forks source link

Only call out to System.currentTimeMillis if in debug mode #98

Closed jentfoo closed 10 years ago

jentfoo commented 10 years ago

This can improve performance as System.currentTimeMillis requires you to trap to the kernel. In our use case (for annoying reasons I rather not get into), we are using your library to scale video frames. Because of that we have to scale lots and lots of images rather quickly, and this means that even these small System.currentTimeMillis calls can be noticeable.

ghost commented 10 years ago

Mike, I appreciate the patch; regardless of the performance, currentTimeMillis shouldn't be getting called for no reason so thank you for the corection.

I interpreted your comment as "we have to use imgscalr for annoying reasons" - if you could reach out to me directly and let me know what is wrong with the lib, maybe I can take away some action items or help understand your use-case a bit better. riyad@thebuzzmedia.com

Thanks

jentfoo commented 10 years ago

Thanks for the quick merge, no gripes at all with the imgscalr library ^.^