Move the benchmarks into a benches/ directory

This commit is contained in:
Erick Tryzelaar 2014-09-06 20:41:13 -07:00
parent 3a5424b13c
commit 0cd64bfb14
6 changed files with 54 additions and 34 deletions

View File

@ -1,8 +1,17 @@
#![feature(phase)]
#[phase(plugin)]
extern crate serde_macros;
extern crate serde;
extern crate serialize;
extern crate test;
use test::Bencher;
use serialize::{Decoder, Decodable};
use de::{Deserializer, Deserializable};
use serde::de::{Deserializer, Deserializable};
//////////////////////////////////////////////////////////////////////////////
@ -178,7 +187,7 @@ mod decoder {
mod deserializer {
use super::{Animal, Dog, Frog, Error, EndOfStream, SyntaxError};
use de;
use serde::de;
enum State {
AnimalState(Animal),

View File

@ -1,5 +1,10 @@
#![feature(phase, macro_rules)]
#![allow(non_camel_case_types)]
#[phase(plugin)]
extern crate serde_macros;
extern crate serde;
extern crate serialize;
extern crate test;
extern crate time;
@ -8,10 +13,10 @@ use std::io;
use std::io::MemWriter;
use test::Bencher;
use json;
use de;
use ser::Serializable;
use ser;
use serde::de;
use serde::json;
use serde::ser::Serializable;
use serde::ser;
#[deriving(Encodable, Decodable)]
#[deriving_serializable]
@ -1229,7 +1234,7 @@ fn bench_manual_my_mem_writer3_escape(b: &mut Bencher) {
}
fn direct<W: Writer>(wr: W, log: &Log) {
use ser::Serializer;
use serde::ser::Serializer;
let mut serializer = json::Serializer::new(wr);
serializer.serialize_struct_start("Log", 12).unwrap();

View File

@ -1,10 +1,19 @@
#![feature(phase)]
#[phase(plugin)]
extern crate serde_macros;
extern crate serde;
extern crate serialize;
extern crate test;
use std::fmt::Show;
use std::collections::HashMap;
use test::Bencher;
use serialize::{Decoder, Decodable};
use de::{Deserializer, Deserializable};
use serde::de::{Deserializer, Deserializable};
//////////////////////////////////////////////////////////////////////////////
@ -164,7 +173,7 @@ mod deserializer {
use super::{Error, EndOfStream, SyntaxError};
use de;
use serde::de;
#[deriving(PartialEq, Show)]
enum State {

View File

@ -1,9 +1,18 @@
#![feature(phase)]
#[phase(plugin)]
extern crate serde_macros;
extern crate serde;
extern crate serialize;
extern crate test;
use std::collections::HashMap;
use test::Bencher;
use serialize::{Decoder, Decodable};
use de::{Deserializer, Deserializable};
use serde::de::{Deserializer, Deserializable};
//////////////////////////////////////////////////////////////////////////////
@ -256,7 +265,7 @@ mod decoder {
mod deserializer {
use std::collections::HashMap;
use super::{Outer, Inner, Error, EndOfStream, SyntaxError};
use de;
use serde::de;
enum State {
OuterState(Outer),

View File

@ -1,9 +1,18 @@
#![feature(phase)]
#[phase(plugin)]
extern crate serde_macros;
extern crate serde;
extern crate serialize;
extern crate test;
use std::fmt::Show;
use test::Bencher;
use serialize::{Decoder, Decodable};
use de::{Deserializer, Deserializable};
use serde::de::{Deserializer, Deserializable};
//////////////////////////////////////////////////////////////////////////////
@ -241,7 +250,7 @@ mod deserializer {
use super::{Error, EndOfStream, SyntaxError};
use de;
use serde::de;
#[deriving(PartialEq, Show)]
enum State {

View File

@ -6,15 +6,9 @@
#[cfg(test)]
extern crate test;
#[phase(plugin, link)]
extern crate log;
#[phase(plugin)]
extern crate serde_macros;
#[cfg(test)]
extern crate debug;
#[cfg(test)]
extern crate serialize;
@ -25,21 +19,6 @@ pub mod de;
pub mod ser;
pub mod json;
#[cfg(test)]
pub mod bench_enum;
#[cfg(test)]
pub mod bench_struct;
#[cfg(test)]
pub mod bench_vec;
#[cfg(test)]
pub mod bench_map;
#[cfg(test)]
pub mod bench_log;
// an inner module so we can use serde_macros.
mod serde {
pub use de;