-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow processing with composite SVG which contains <text> #2987
Comments
|
Hi, this sample code fails with If I change Are you using the prebuilt libvips binaries provided by sharp? Perhaps you've installed the |
|
Hey @lovell, thanks for the response. You're absolutely right, there is an error with SVG height, I've edited the code. Based on this page https://sharp.pixelplumbing.com/install, I've installed the lib with a simple Edit: Is it possible than other libs installed locally like |
|
@robinparisi Were you able to make any progress with this? |
|
@lovell I couldn't find any reason at the moment. I've tried on multiple mac mini and except for the M1 one (wich is really fast anyway), it always takes more time with SVG text, by oposition to simple SVG with no text which is way faster. I've also tried with node v16.13.2 : |
|
Please can you profile this script via a tool such as callgrind. Install via Please can you provide the output of running |
|
Quick thought: do you have |
|
So, I had over 2000 fonts. I've tried to uninstall all my custom fonts and run the test script again. Execution time dropped under 500 ms. It seems that execution time is correlated to the number of fonts available (fontconfig is installed) PS: I'm not sure I can install Valgrind from brew (not sure why atm) |
|
Thanks for the update, this does sound like font discovery is the problem. I hadn't realised valgrind is unavailable for macOS via homebrew, sorry. You might be able to use kcachegrind, which appears to be available via MacPorts - https://github.com/macports/macports-ports/tree/master/kde/kcachegrind4 |
|
Closing as there's probably nothing we can do in sharp for this. fontconfig provides the |




Hi,
I'm trying to add a text to my picture by using composite API and an SVG wich contains a
<text>element. When I remove<text>, or try with a simple SVG, the process only takes a few ms (< 10ms) for one picture. As soon as I add a<text>element, it takes many seconds (> 7s) to process. Below a simple example with a measurment of execution time.With result:
Informations:
Interesting point: I've tried the same code on a colleague's mac computer with M1 chip and it took only ~70ms to process (and ~5ms without
<text>element).I'm not sure it's directly related to this lib, I saw a few issues with SVG but none wich implies
<text>in the process with the composite API.The text was updated successfully, but these errors were encountered: