rust-bakery / parser_benchmarks Goto Github PK
View Code? Open in Web Editor NEWBenchmarks for the nom, the Rust parser combinators library
Benchmarks for the nom, the Rust parser combinators library
It would be nice to add some benchmarks for pom, a PEG parser combinator library similar to nom that eschews macros in favor of regular Rust functions and operator overloading. It would be interesting to see how well it stacks up against the other libraries.
I would be happy to try to port the upstream JSON (u8) and JSON (char) pom examples as benchmarks, but I'm not sure how I am supposed to benchmark and render the results into Markdown. Any help on how to do this reliably and reproducibly would be appreciated.
The json comparisons currently use HashMap with the standard library's default (collision-resistant) hash function. A comparatively large amount of time in those benchmarks is spent hashing rather than parsing. Considering that this project is intended to be a comparison of parsing libraries, it would be good to use a quicker hash function like fnv
in those hashmaps.
with stable rustc 1.33.0
error[E0554]: #![feature] may not be used on the stable release channel
--> src/main.rs:1:1
|
1 | #![feature(const_fn)]
| ^^^^^^^^^^^^^^^^^^^^^
error[E0554]: #![feature] may not be used on the stable release channel
--> src/main.rs:2:1
|
2 | #![feature(cfg_target_feature, target_feature, stdsimd)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
with version 1.34.0-nightly (c1d2d83ca 2019-03-01)
error[E0019]: constant function contains unimplemented expression type
--> src/combinators.rs:245:12
|
245 | return c == '\t' as u8 || (c > 31 && c != 127);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0019]: constant function contains unimplemented expression type
--> src/combinators.rs:251:14
|
251 | return !(c <= 32 || c >= 127 || c == '(' as u8 || c == ')' as u8 || c == '<' as u8
| ^^^^^^^^^^^^^^^^^^^
I benched everything on my PC, i get the following results. I compared it to the intel CPU (i think this is the one in the macbook).
The attoparsec bench is done with the code in #24
combine-http and attoparsec have big differences. I would also be interested to see the results with the current code on the macbook. I'm surprised by the 87.17% to 142% swing in the results, i didn't think the architecture of the CPU would matter that much.
Can be useful for convenience. I can contribute this once I have free time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.