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

Add CSS parsing runtime benchmark #1655

Merged
merged 1 commit into from Jul 18, 2023
Merged

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Jul 14, 2023

This time it's a bit more realistic benchmark. It benchmarks a CSS parser from Servo. I took a big CSS file (500 KiB minified) from Facebook and use an inflated version of it as the input workload.

Finished css/css-parse-fb (1/1)
    [Instructions]: min:   1,494,033,457    mean:    1,495,484,195    stddev:     729,403
          [Cycles]: min:     865,386,053    mean:      923,950,913    stddev:  94,493,454
  [Wall time [µs]]: min:         216,808    mean:          239,945    stddev:      23,147
   [Branch misses]: min:       2,871,605    mean:        2,975,395    stddev:     152,240
    [Cache misses]: min:       4,287,881    mean:        4,779,429    stddev:     781,760

@Kobzol Kobzol requested a review from nnethercote July 14, 2023 14:27
@nnethercote
Copy link
Contributor

I took a big CSS file (500 KiB minified) from Facebook and use an inflated version of it as the input workload.

What's the specific meaning of "inflated" here?

@Kobzol
Copy link
Contributor Author

Kobzol commented Jul 17, 2023

A larger version of that file, created by repeating its contents N times.

@nnethercote
Copy link
Contributor

Could the benchmark just iterate N times instead?

@Kobzol
Copy link
Contributor Author

Kobzol commented Jul 17, 2023

Of course, that's another solution. It's just a bit more fragile in my view, since we need to make sure that the compiler will not optimize the loops away.

@nnethercote
Copy link
Contributor

Read it from the file and then duplicate it ten times in memory?

@Kobzol
Copy link
Contributor Author

Kobzol commented Jul 17, 2023

Yeah, that's what currently happens (https://github.com/rust-lang/rustc-perf/pull/1655/files#diff-bc608464de804456d49a923fbb68f2ced93ea41d17793d22e5b3ae7aea4d7519R11). Note: the "inflation" process currently happens in main by repeating the file in memory. The file on disk is the original CSS file from Facebook.

Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought the file contained ten copies of the data. Duplicating it in memory seems fine.

@Kobzol Kobzol merged commit f8cc0b2 into rust-lang:master Jul 18, 2023
9 checks passed
@Kobzol Kobzol deleted the runtime-css branch July 18, 2023 05:43
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.

None yet

2 participants