Skip to content

Parsing performance #56

@dalance

Description

@dalance

At veryl, parsing performance is about 64KiB/s now:

     Running benches/benchmark.rs (target/release/deps/benchmark-dbdacafbf8409011)
Benchmarking throughput/parse: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 19.1s, or reduce sample count to 20.
throughput/parse        time:   [190.85 ms 195.85 ms 202.96 ms]
                        thrpt:  [62.594 KiB/s 64.866 KiB/s 66.565 KiB/s]
                 change:
                        time:   [+37.181% +40.784% +45.521%] (p = 0.00 < 0.05)
                        thrpt:  [-31.281% -28.969% -27.104%]
                        Performance has regressed.
Found 17 outliers among 100 measurements (17.00%)
  7 (7.00%) high mild
  10 (10.00%) high severe

In my expexience, the performance is affected by the number of terminals.
For example, the performance is degraded by increasing reserverd keyword.

The flamegraph is below. It shows almost all time is consumed at regex::pikevm in parol's lexer.
This issue may be the same as rust-lang/regex#787.
BurntSushi seems to try to implement new regex engine to improve it.
If my prediction is correct, it is required that removeing regex from lexer or waiting the new regex engine to improve the performance of parol.

flamegraph

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions