Skip to content

Commit

Permalink
fix(benchmark): remove old code
Browse files Browse the repository at this point in the history
It didn't compile anymore, and also probably wasn't
really testing us anyway.
  • Loading branch information
Byron committed Jan 2, 2017
1 parent fd4cd36 commit f969498
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "json-tools"
version = "0.3.0"
version = "1.0.0"
authors = ["Sebastian Thiel <[email protected]>"]
license = "MIT/Apache-2.0"
description = "A collections of tools to handle json encoded data"
repository = "https://github.com/Byron/json-tools"
keywords = ["json", "tools", "lexer"]
documentation = "http://byron.github.io/json-tools"
documentation = "https://docs.rs/crate/json-tools"
27 changes: 2 additions & 25 deletions benches/usage.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#![feature(test, io)]
#![feature(test)]

extern crate json_tools;
extern crate test;

use json_tools::{Lexer, FilterTypedKeyValuePairs, BufferType, TokenType,
TokenReader, Token, Buffer, Span};
use std::io::{self, Read};
use std::io;

const NULL_RIDDEN: &'static str = r##"
{
Expand Down Expand Up @@ -257,26 +257,3 @@ fn span_lexer_throughput_with_cursor(b: &mut test::Bencher) {
});
b.bytes = NULL_RIDDEN.len() as u64;
}


#[bench]
fn span_lexer_throughput_with_cursor_and_tee(b: &mut test::Bencher) {
use std::io::{Cursor, Read};

b.iter(|| {
let mut keeper = Cursor::new(Vec::<u8>::new());
{
let it = Lexer::new(Cursor::new(NULL_RIDDEN.as_bytes())
.tee(&mut keeper)
.bytes()
.filter_map(|r|r.ok()),
BufferType::Span);
for t in it {
test::black_box(t);
}
}
assert_eq!(keeper.into_inner().len(), NULL_RIDDEN.len());
});
b.bytes = NULL_RIDDEN.len() as u64;
}

0 comments on commit f969498

Please sign in to comment.