cppfw / svgren

:camera: SVG rendering library in C++
MIT License
206 stars 41 forks source link

Reading SVG files is slow #75

Closed chengang151 closed 3 years ago

chengang151 commented 4 years ago

nonsupport.zip Some SVG is not supported,like this.

chengang151 commented 4 years ago

不支持.zip不支持某些 SVG,像这样。

E/libc++abi: terminating with uncaught exception of type mikroxml::malformed_xml: Unknown numeric character reference encountered: x30EC line: 4

igagis commented 4 years ago

The problem was in one of the dependent libraries, the mikroxml. The fix is available in mikroxml version 0.1.27. Please update your libraries and try again.

chengang151 commented 4 years ago

Thank you for your reply, which solves my problem. Thank you very much.However, I compared it to some similar libraries and found that the parsing was slow,Such as lunasvg,"https://github.com/sammycage/lunasvg".

igagis commented 4 years ago

do you mean reading svg file or rendering it is slower than lunasvg?

chengang151 commented 4 years ago

Yes,Reading SVG is a bit slow, tested SVG, and some larger ones require 5s.For now, the compatibility is ok, and I will encounter some new SVG in the test.

igagis commented 4 years ago

Can you share the SVG files you use d for testing, so I could test as well? How long does it take to read those large SVGs using lunasvg?

chengang151 commented 4 years ago

render_test_test.zip To facilitate the comparison, I uploaded this VS project.SVG is in the sample.3.072.svg.There are also android projects, which are faster on Android.

chengang151 commented 4 years ago

log.txt.Time comparison on Android.Lunasvg, of course, has its bugs.

chengang151 commented 4 years ago

svgren-master-cg.zip,This is the lunasvg project,Android 8.0 needs a signature to read the path properly.

chengang151 commented 4 years ago

Hess 8.0 Android, reads about 5s more, the other one about 1s more.Render 1s more,lunasvg render 200ms.

igagis commented 4 years ago

could you re-upload the render_test_test.zip file again? For some reason zip cannot unpack it... saying that fle format is not supported. The other zip file unpacked successfully.

chengang151 commented 4 years ago

msvs_solution_vs.zip Vs project.

chengang151 commented 4 years ago

msvs_solution_vs_new.zip use this.

igagis commented 4 years ago

Thanks, I could download an unpack the zip file now. I'll take a look at why is it slow.

igagis commented 3 years ago

possible performance improvement would be to avoid using istringstream, see https://github.com/cppfw/svgdom/issues/24

igagis commented 3 years ago

I've implemented a number of optimizations to svgdom version 0.3.66. Now loading should be like 6x faster.