Mercurial > lbo > hg > rcombinators
changeset 37:1d67d854b5d7
Use whole input for integer benchmarks
author | Lewin Bormann <lewin@lewin-bormann.info> |
---|---|
date | Fri, 07 Jun 2019 18:22:19 +0200 |
parents | d65f832b5e2e |
children | 8569decb05da |
files | src/primitives.rs src/state.rs |
diffstat | 2 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/primitives.rs Fri Jun 07 18:15:13 2019 +0200 +++ b/src/primitives.rs Fri Jun 07 18:22:19 2019 +0200 @@ -382,9 +382,7 @@ { time_test!("parse-int with static buffer"); for _ in 0..1000 { - let h = ps.hold(); let _ = p.parse(&mut ps); - ps.reset(h); } } @@ -395,9 +393,7 @@ { time_test!("parse-int with dynamic buffer"); for _ in 0..1000 { - let h = ps.hold(); let _ = p.parse(&mut ps); - ps.reset(h); } } } @@ -413,9 +409,7 @@ { time_test!("parse-float with combinators"); for _ in 0..1000 { - let h = ps.hold(); let _ = p.parse(&mut ps); - ps.reset(h); } } }
--- a/src/state.rs Fri Jun 07 18:15:13 2019 +0200 +++ b/src/state.rs Fri Jun 07 18:22:19 2019 +0200 @@ -146,7 +146,12 @@ if self.current < Self::GARBAGE_COLLECT_THRESHOLD { return false; } - //println!("GC: Collecting {} elements between {} and {}", self.current-1, self.global, self.global+self.current-1); + /*println!( + "GC: Collecting {} elements between {} and {}", + self.current - 1, + self.global - self.current, + self.global - 1 + );*/ // We can collect up to self.current-1. self.buf.rotate_left(self.current - 1); self.buf @@ -163,7 +168,12 @@ if ix < Self::GARBAGE_COLLECT_THRESHOLD { return false; } - //println!("GC: Collecting {} elements between {} and {}", ix-1, self.global-self.buf.len()+1, ix-1); + /*println!( + "GC: Collecting {} elements between {} and {}", + ix - 1, + self.global - self.buf.len() + 1, + ix - 1 + );*/ self.buf.rotate_left(ix - 1); self.buf.resize(self.buf.len() - ix + 1, 0 as char); self.current = 1;