Skip to content
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

Improved SVG rendering speed in Google Chrome and Chromium #23

Closed
wants to merge 4 commits into from
Closed

Improved SVG rendering speed in Google Chrome and Chromium #23

wants to merge 4 commits into from

Conversation

mandulaj
Copy link

@mandulaj mandulaj commented Oct 7, 2014

After doing a few experiments I concluded that Google Chrome 37.0.2062 (64-bit) has the worst SVG noise rendering implementation. Chromium v40.0.2172 (64-bit) is still slow but it is significantly faster! For the purpose of speeding up the rendering I suggest reducing the numOctavesvalue from 10 to 1. The rendering speed improvement is far more obvious then the visual difference. Also comparing Google Chrome and Firefox yields a much greater visual difference then tweaking the numOctaves value. From all tests I also concluded that Firefox has outperformed all the competitors in noise-rendering

Firefox vs Chromium

Just for the sake of OCD this is the comparison between numOctaves: 1 and numOctaves: 10

1 vs 10

The update time was on average 0.6 s for numOctaves:1 and 1.9 s for numOctaves:10

That is more then twice as fast render time.

(All Tests were performed using Windows 8.1 and Debian 7.6 running on a Intel i5-3330 3.0GHz quad-core and NVIDIA GeForce GT 630)

@qrohlf
Copy link
Owner

qrohlf commented Oct 7, 2014

Thanks for doing the digging on this. I'm curious - how are you timing the time for the browser to render the SVG? Can you attach a listener of some kind to the SVG that gets fired when the render is complete?

I'm getting merge conflicts when I try to rebase this onto the current version. Since the 4 commits in this PR effectively only change one line of code, I'm going to port this over manually.

@qrohlf qrohlf closed this Oct 7, 2014
qrohlf added a commit that referenced this pull request Oct 8, 2014
This commit decreases the numOctaves used in the feTurbulence
fractalNoise SVG filter from 10 to 3. @zpiman investigated this in
PR #23 and found it to have a significant impact on SVG render time.
While I found that reducing it all the way down to 1 caused a visual
impact on the generated noise, 3 seems to be a good compromise that
improves performance significantly while staying visually
indistinguishable from 10.
@mandulaj
Copy link
Author

mandulaj commented Oct 8, 2014

I see you increased the number to 3. That is Ok 👍. Also with the timing as far as I know you can't attach any callback to the SVG rendering. So I first used the old style: load the page and start the stopwatch method. But now I am using the dev tools Timeline -> look for the long paint process.

numOctaves: 3

numOctaves: 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants