-
Notifications
You must be signed in to change notification settings - Fork 653
bench: Add JSON support to xtask bench
#3845
Conversation
ed401b2
to
eca6a40
Compare
let parse_duration = parser_timer.stop(); | ||
|
||
#[cfg(feature = "dhat-heap")] | ||
println!("Parsed"); | ||
#[cfg(feature = "dhat-heap")] | ||
let stats = print_diff(stats, dhat::HeapStats::get()); | ||
|
||
let tree_sink_timer = timing::start(); |
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.
I removed the timing on the different phases because it otherwise requires opening up some of the parser internals.
aab4602
to
15eead4
Compare
eca6a40
to
629dfc8
Compare
629dfc8
to
bc15476
Compare
15eead4
to
69eb14e
Compare
!bench_parser |
Parser Benchmark Results
|
69eb14e
to
c2282a3
Compare
✅ Deploy Preview for docs-rometools canceled.
|
Comparing bench: Add JSON support to
1 page tested
|
Chrome Desktop | iPhone, 4G LTE | Motorola Moto G Power, 3G connection |
---|---|---|
Most significant changes
27 other significant changes: JS Parse & Compile on Chrome Desktop, Total Blocking Time on Chrome Desktop, Largest Contentful Paint on Motorola Moto G Power, 3G connection, First Contentful Paint on Motorola Moto G Power, 3G connection, Total CSS Size in Bytes on Chrome Desktop, Total CSS Size in Bytes on iPhone, 4G LTE, Total CSS Size in Bytes on Motorola Moto G Power, 3G connection, Time to Interactive on Motorola Moto G Power, 3G connection, Total Page Size in Bytes on Chrome Desktop, Total Page Size in Bytes on iPhone, 4G LTE, Total Page Size in Bytes on Motorola Moto G Power, 3G connection, Largest Contentful Paint on Chrome Desktop, First Contentful Paint on Chrome Desktop, Time to Interactive on Chrome Desktop, Number of Requests on Motorola Moto G Power, 3G connection, Number of Requests on Chrome Desktop, Number of Requests on iPhone, 4G LTE, Speed Index on Motorola Moto G Power, 3G connection, Time to Interactive on iPhone, 4G LTE, First Contentful Paint on iPhone, 4G LTE, Largest Contentful Paint on iPhone, 4G LTE, Speed Index on Chrome Desktop, Total HTML Size in Bytes on Chrome Desktop, Total HTML Size in Bytes on iPhone, 4G LTE, Total HTML Size in Bytes on Motorola Moto G Power, 3G connection, Lighthouse Performance Score on Motorola Moto G Power, 3G connection, Lighthouse Performance Score on Chrome Desktop
Calibre: Site dashboard | View this PR | Edit settings | View documentation
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
I wonder if we should specialize the commands now. Like, I don't think we all want to run all the parsers using Maybe we should have commands like:
Same thing for the formatter |
You can pass a test suite and even filter by test name
|
Sorry, I actually meant the magic comments we use here to run the benchmarks in the GitHub actions. I didn't put the |
That could be useful. The JSON tests don't add much but this is something we can tackle separately |
use rome_js_syntax::{JsAnyRoot, JsSyntaxNode, SourceType}; | ||
use rome_parser::prelude::ParseDiagnostic; | ||
|
||
pub enum Parse<'a> { |
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.
Nit: these could probably be implemented as traits instead of enums, to avoid introducing an extra match
in the benchmark loop (although its impact on the benchmark is probably insignificant)
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.
Using traits makes the benchmark code somewhat awkward because it would need different code paths for each language to avoid a dynamic dispatch (using &dyn
). That's why I prefer the current solution, particularly because the match
overhead should be neglectable considering what we're measuring in the benchmarks.
1281a59
to
79cebd4
Compare
79cebd4
to
9a5c13e
Compare
!bench_formatter |
Formatter Benchmark Results
|
Summary
Add new JSON benchmarks to
xtask bench
.Doing so required to refactor
xtask bench
to have genericparse
,analyze
andformat
functions.Test Plan
I ran
xtask bench
for the parser, formatter, and linter, with criterion on that enabled/disabled.