Bug 64998 - emf convert png too slow
Summary: emf convert png too slow
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC Mac OS X 10.1
: P2 normal with 4 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-17 08:16 UTC by liming-coder
Modified: 2020-12-23 18:36 UTC (History)
0 users



Attachments
image1.emf (117.74 KB, image/emf)
2020-12-17 08:16 UTC, liming-coder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description liming-coder 2020-12-17 08:16:17 UTC
Created attachment 37622 [details]
image1.emf

convert the attached emf to png is too slow(~20s). 
on my machine, other wmf/emf conversion is quite fast(normally <1s).
Comment 1 liming-coder 2020-12-17 08:22:35 UTC
also i feel the lastest version is a bit slowdown regarding emf/wmf conversion, though there is no acutual benchmark test.
Comment 2 liming-coder 2020-12-17 08:33:06 UTC
i tried https://www.photopea.com/ by dragging the image1.emf into it. it display lines and shapes quite fast, and then it start loading some fonts,which is a bit slow(maybe it need to load font from server).
with poi,maybe it's also related to font loading?
Comment 3 liming-coder 2020-12-17 08:33:36 UTC
i tried https://www.photopea.com/ by dragging the image1.emf into it. it display lines and shapes quite fast, and then it start loading some fonts,which is a bit slow(maybe it need to load font from server).
with poi,maybe it's also related to font loading?
Comment 4 liming-coder 2020-12-17 08:36:47 UTC
i also tried https://www.photopea.com/ by dragging image1.emf into it. it displays lines and shapes quite fast, then it start loading somes fallback fonts, which is a bit slow(i guess these fonts need to load from server).

with poi, maybe it's the same font loading problem??
Comment 5 liming-coder 2020-12-17 08:38:37 UTC
shit, i posted it three times. sorry. maybe slow network...
Comment 6 Andreas Beeker 2020-12-18 21:42:24 UTC
Sometimes adding -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine to the JVM args helps - see the render page for more details.

In this case it didn't make any difference.
I've tested it with Java 14 (2.5sec) and Java 8 (9.2sec) on my machine.

I'll try a bit of profiling now.
Comment 7 liming-coder 2020-12-23 08:10:16 UTC
can you post the render page link please.

thanks.
Comment 9 Andreas Beeker 2020-12-23 18:36:21 UTC
I forgot to mentioned, that I've profiled the slideshow and most of the time is spent in Graphics2D.draw(), but doesn't mean POI isn't to be blamed of the bad performance.

My guess is, the culprit are the dotted lines - those can be really time-consuming when the wrong scaling and other parameters are given. Parts of the image are anyway distorted, but I haven't found out why yet ...