-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add SVG parsing and rendering runtime benchmark #1656
Conversation
|
In #1618 you were worried about me adding an 800KiB benchmark, and this is 30MiB. Does it need to be that big? |
|
Yeah I also remembered my comment :) I guess that the difference for me was that the additional files for the compile benchmark were useless to us, while this file serves an actual purpose. But you are right that 30 MiB is a lot. Repeating/inflating SVG isn't that simple as e.g. for CSS, but I'll try to think of something to reduce the file size, while keeping the benchmark reasonably long. I guess that we can always just do N iterations of parsing. |
|
One approach if we don't mind network access is to put the files outside the repo (e.g., S3) - which at least keeps the repo itself small, even though in practice I guess they're still needed to run things. |
|
I would like to avoid introducing such remote dependency into the benchmark, and thus making it less self-contained. It's true that we also have to download all crate dependencies from the internet, but that is cached in After gzipping the file, it is ~4.5 MiB. Would such size be acceptable? It's not that easy to simply repeat SVG files, as it is e.g. with CSS. If it's still too big, I'll try to find a SVG that compresses better or somehow generate it dynamically by repeating some of its inner contents. |
|
I can live with the 4.5MB gzipped file. |
|
Ok. I added documentation about adding runtime benchmark input files and how to (de)compress them. I force-pushed the compressed SVG file, so that the larger original file is not in git history. I also compressed the 11 MiB text file that was already present in the repo (this won't help with it being included in git history, but at least it will be smaller on disk and in the binary). |
|
@nnethercote Let me know if you have any further comments :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I overlooked the re-review.
Runtime benchmark that tests parsing and rendering of a big-ass ~30 MiB SVG file from Wikipedia.
So far I have been mostly including these test files directly into the binary (and sometimes inflating/repeating them). I wonder if there is any disadvantage to this, as opposed to loading them at runtime (at the beginning of the program). I like that the embedding makes the runtime benchmarks more self-contained and I don't have to think about in which working directory they are being executed.
The stddev of instructions in rendering is pretty low, which is sweet. For parsing it's much higher on the other hand, but still relatively low percentually wise (0.01%).