Open Merg1255 opened 12 years ago
Using workers is hard because the code we compiled isn't multithreaded.
Can you profile in Chrome to see why this is so slow? Maybe we can hand-optimize some functions.
just tested with some files, and the time needed for rendering is quite big. actually, anything more tan 2-3 seconds would not do for a website.
But there's an interesting point: jpeg2000 allows someone to view "part" of a page, without downloading the whole file, like 100MB. Could we change the canvas function to ask for specific parts of the image?
thanks
What does the Chrome JS profiler say? Maybe most of the time is in one function that we can optimize.
If the OpenJPEG2000 implementation supports viewing part of a page, we should be able to support it in j2k.js
i'm using firefox :) but i'll probably try to use the chrome profiler the following days to see about the functions.
There is also a profiler for Firefox,
https://github.com/bhackett1024/CodeInspector
but it is experimental and requires a debug build of Firefox. It does give more in-depth information than the Chrome profiler though.
Another option is to add some manual profiling printouts in the main OpenJPEG functions. Could be easy to find out what we need to optimize.
will check it out soon I think. thanks!
ok, the most intensive cpu function is the one that actually draws the pixels in the pixel area, but I guess this can be easily seen without a cpu profiler.
Which function is that?
it's function " xhr.onreadystatechange = function(e) { ... } ". My example is basically your example file here with a quite big jp2 file: https://github.com/kripken/j2k.js/blob/master/examples/simple.html
I see. We would need more detailed profiling information, inside the compiled code, to know which functions are the slow ones there.
yes :-)
Check these files: https://github.com/downloads/bitsgalore/jp2StructCheck/testImages.zip http://www.openjpeg.org/index.php?menu=samples Chrome takes some time to render the images, but it finally does. Firefox 10.0.2 continues to prompt about the script running.
Is there a way we could speed the rendering up by using more workers?
Thanks