-
Notifications
You must be signed in to change notification settings - Fork 76
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
macSVG rendering performance needs x10 improvement #3
Comments
johnblommers - Thanks for your note and link to an interesting SVG file, which contained many "use" elements. I found the main slowdown to be during the initial loading of the pattern.svg document. It was taking 20 seconds, which was clearly too long. I found this line in MacSVGDocumentWindowController.m, at line 1065 -
After that line was disabled, your pattern.svg document loaded much faster. In the user interface, it means that the hierarchical outline view of the SVG document will be fully collapsed when the document is open. I'll commit a couple of line changes to the repository and do further testing. The expandAllNodes call when the document is opened might become a conditional operation depending on the number of elements the SVG document. It will likely be included in the next release. The rendering speed in this SVG editing application will always be slower than in a web browser. Although this project is moving to Swift language, that probably won't affect the rendering speed much. Some of the slower rendering is due to unnecessary multiple updates of the web view and other views. Those can be fixed in the future by deferring screen updates to the end of the event cycle. Another possibility for faster performance is to fork WebKit and restore the old Objective-C APIs for SVG which Apple removed a few years ago, or at least exposing some WebCore properties and functions for custom usage. But maintaining a separate fork of WebKit would be a big project. Currently, macSVG uses the standard WebKit framework in macOS. |
You could improve performance by moving to WebKit 2 / WKWebView. I wouldn't bet too much on the synchronous WebKit 1 API as it's very likely going to be deprecated in future. |
Unzip and open the attached file
pattern.svg.zip
with macSVG and you will observe how slow the rendering engine is. Dropping the same file onto the Chrome web browser renders the image almost instantly. Hopefully the migration to Swift and perhaps an eye to the SVG rendering engine will provide a much-needed rendering boost. As it stands right now there is considerable time spent in the BBOD.pattern.svg.zip
The text was updated successfully, but these errors were encountered: