forked from rusty-ecma/RESS
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* possible performance improvements? * clippy + spelling * added zero-copy parsers and related constucts. Made some stuff public to allow for benchmarking how worth it is it * fix keyword issues * cargo fmt * remove unused parsers * trim_left_matches > trim_start_matches * ref_scanner now available * add refs flag to major_libs example * unneeded * cargo fmt * reconcile changes on master * RefScanner bug fixes * update travis to include moz_central test * bump version * remove auto enabing logging
- Loading branch information
Showing
29 changed files
with
3,674 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ Cargo.lock | |
*.log | ||
*.js | ||
package-lock.json | ||
moz-central |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
| output | refs bench | refs +/- | orig bench | orig +/- | | ||
| --------- | ---------- | -------- | ---------- | -------- | | ||
| bools | 196 | 12 | 498 | 28 | | ||
| comments | 5,830 | 1260 | 8,658 | 198 | | ||
| idents | 32,232 | 947 | 37,967 | 1680 | | ||
| keywords | 23,050 | 6,436 | 20,375 | 197 | | ||
| null | 83 | 5 | 97 | 3 | | ||
| numbers | 11,521 | 2,872 | 21,999 | 621 | | ||
| punct | 24,985 | 497 | 34,006 | 1,918 | | ||
| regex | 26,558 | 642 | 71,059 | 2,093 | | ||
| strings | 23,251 | 4,121 | 50,262 | 1,363 | | ||
| templates | 34,015 | 544 | 68,190 | 921 | | ||
| token | 293,377 | 9,556 | 343,875 | 9,141 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#![cfg(test)] | ||
#![feature(test)] | ||
extern crate ress; | ||
extern crate test; | ||
use ress::Scanner; | ||
use test::Bencher; | ||
#[bench] | ||
fn angular(b: &mut Bencher) { | ||
let js = include_str!("../node_modules/angular/angular.js"); | ||
b.iter(|| { | ||
let s = Scanner::new(js); | ||
let _: Vec<ress::Item> = s.collect(); | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#![cfg(test)] | ||
#![feature(test)] | ||
extern crate combine; | ||
extern crate ress; | ||
extern crate test; | ||
|
||
use combine::Parser; | ||
use ress::numeric::literal as number; | ||
use test::Bencher; | ||
#[bench] | ||
fn number_non_decimal(b: &mut Bencher) { | ||
b.iter(|| { | ||
number().parse("0x5541ff6").unwrap(); | ||
}); | ||
} |
Oops, something went wrong.