svgexport icon indicating copy to clipboard operation
svgexport copied to clipboard

Performance for svg -> png has decreased between 0.2.8 and 0.3.2

Open mpfluger opened this issue 8 years ago • 5 comments

The performance when converting svg files to png has decreased quite a bit between those versions. It's most likely related to the PhantomJS changes. It's not a bug in that sense and it's not critical. I just wanted to mention it, as the difference is pretty huge.

For a sample file, real processing time went from 0.7 seconds to 12.8 seconds. The generated files are the same.

mpfluger avatar Mar 01 '17 16:03 mpfluger

This is caused by the switch from the phantomjs2 package to phantomjs-prebuilt. You can safely reverse commit 75250e689df4c5830c40099c4738ad1a68cf2702 to speed it up again.

Before I changed it back I couldn't even run the test suite as it timed out (> 5000ms), now with the commit reversed I have no problems at all.

@shakiba why have you switched to phantomjs-prebuilt? Unless there's a good reason, It's probably best to switch back to phantomjs2.

mdeboer avatar Apr 18 '17 21:04 mdeboer

@mpfluger if you're interested, I opened up a pull request to revert back to phantomjs2 which fixes the performance issues. See #42 👍

mdeboer avatar Apr 18 '17 22:04 mdeboer

If I remember correctly this was the history: Originally we used npm:phantomjs, then at some point to use PhantomJS 2 (when npm:phantomjs-prebuilt was not published yet) we used npm:phantomjs2. However later npm:phantomjs renamed to npm:phantomjs-prebuilt and updated to PhantomJS2, so we used we used npm:phantomjs-prebuilt.

npm:phantomjs2 is fork of npm:phantomjs-prebuilt, I'm not sure why it is slower.

shakiba avatar Apr 19 '17 01:04 shakiba

@mdeboer Thanks for PR! I'll try to figure out what's the problem is with phantomjs-prebuilt and merge your PR as soon as I can.

shakiba avatar Apr 19 '17 01:04 shakiba

Thanks @shakiba and @mdeboer for investigating!

mpfluger avatar Apr 19 '17 13:04 mpfluger