diff --git a/hashmap/.mod.rs.swp b/hashmap/.mod.rs.swp index eae5050..022bf06 100644 Binary files a/hashmap/.mod.rs.swp and b/hashmap/.mod.rs.swp differ diff --git a/hashmap/mod.rs b/hashmap/mod.rs index c8ff19f..29efe7c 100644 --- a/hashmap/mod.rs +++ b/hashmap/mod.rs @@ -15,7 +15,7 @@ pub mod raw_table; //ADD_RANGE - -pub static ADD_RANGE: uint = 256; +pub static ADD_RANGE: uint = 512; pub static VIRTUAL_BUCKET_CAPACITY: uint = 32; #[deriving(Clone)] @@ -249,7 +249,61 @@ fn get_sec_keys(&mut self, index_addr:uint,mfd:uint, free_distance:&uint, mask:u self.resize(); self.insert(key.clone(), data.clone()) } - + pub fn insert_resize(&mut self, key:K, data:V,add_range:uint)-> bool{ + if self.check_key(&key) { + return false; + } + let new_hash = self.hasher.hash(&key); + //println!("Insert hashes to: {}",new_hash) + let mask = self.raw_table.capacity()-1; + let index_addr = mask & (new_hash as uint); + //let mut info = self.get_insert_bucket_info(index_addr,mask); + //let mut info = self.raw_table.get_bucket(index_addr).hop_info.clone(); + let mut free_distance = 0u; + let mut val = 1; + //for i in range(1, ADD_RANGE){ + // if (info & 1) == 0 { + // break; + // } + // info = info >> 1; + // let b_info = self.raw_table.get_bucket((index_addr+i) & mask).hop_info.clone(); + // info = info | b_info; + // //println!("info in insert: {}",info); + // free_distance += 1; + //} + for i in range(0,add_range){ + if !self.raw_table.get_key_option((index_addr+i) & mask) { + break; + } + free_distance += 1; + } + //println!("free_distance in insert: {}",free_distance); + if free_distance < add_range { + while val != 0 { + if free_distance < VIRTUAL_BUCKET_CAPACITY { + //assert!(start_info & (1<u64{ fn main(){ // datapoints are the loads 0.3,0.4,0.5,0.6,0.7,0.8,0.9 calculated with 131072 - let data_point:Vec = vec!(9830,11469,13107,14746,16384,18022,19660,21299,22937,24576,26214); - let mut result_hopscotch:Vec = Vec::with_capacity(12); - let mut result_robin:Vec = Vec::with_capacity(12); + //let data_point:Vec = vec!(9830,11469,13107,14746,16384,18022,19660,21299,22937,24576,26214); + //let data_point:Vec = vec!(1229,1434,1638,1843,2048,2253,2458,2662,2867,3072,3277); + let data_point:Vec = vec!(4915,5734,6554,7373,8192,9011,9830,10649,11469,12288,13107); + let mut result_hopscotch:Vec = Vec::with_capacity(12); + let mut result_robin:Vec = Vec::with_capacity(12); let load_factor = vec!(0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8); let mut it = 0; for i in data_point.iter(){ @@ -64,13 +68,15 @@ fn main(){ for _ in range(0,AVG_SIZE){ sum += insert_lookup_remove_hopscotch(*i,OPERATIONS); } - let time_hopscotch = sum/AVG_SIZE; + let sum_milli = (sum as f64)/1000000f64; + let time_hopscotch = (OPERATIONS as f64)/(sum_milli/(AVG_SIZE as f64)); result_hopscotch.push(time_hopscotch); let mut sum2 = 0u64; for _ in range(0,AVG_SIZE){ sum2 += insert_lookup_remove_robin(*i,OPERATIONS); } - let time_robin = sum2/AVG_SIZE; + let sum_milli2 = (sum2 as f64)/1000000f64; + let time_robin = (OPERATIONS as f64)/(sum_milli2/(AVG_SIZE as f64)); result_robin.push(time_robin); it += 1; } diff --git a/test/benchmark-files/bench-90lookup-5insert-5remove b/test/benchmark-files/bench-90lookup-5insert-5remove index 86468d4..f70941e 100755 Binary files a/test/benchmark-files/bench-90lookup-5insert-5remove and b/test/benchmark-files/bench-90lookup-5insert-5remove differ diff --git a/test/benchmark-files/bench-90lookup-5insert-5remove.rs b/test/benchmark-files/bench-90lookup-5insert-5remove.rs index 327d9f5..0ac77a3 100644 --- a/test/benchmark-files/bench-90lookup-5insert-5remove.rs +++ b/test/benchmark-files/bench-90lookup-5insert-5remove.rs @@ -14,17 +14,19 @@ mod raw_table; #[path="../hashers.rs"] mod hashers; -static HASHMAP_CAPACITY:uint = 32768; -static OPERATIONS:uint = 500; +//static HASHMAP_CAPACITY:uint = 32768; +//static HASHMAP_CAPACITY:uint = 4096; +static HASHMAP_CAPACITY:uint = 16384; +static OPERATIONS:u64 = 500; static AVG_SIZE:u64 = 10; -fn insert_lookup_remove_robin(load:uint,ops:uint)->u64{ +fn insert_lookup_remove_robin(load:uint,ops:u64)->u64{ let mut m = HashMap::with_capacity(HASHMAP_CAPACITY); for i in range(1,load){ m.insert(i,i+1); } let start = precise_time_ns(); - for i in range(load,load+ops){ + for i in range(load,load+(ops as uint)){ m.insert(i,i+1); for _ in range(0,18){ m.find(&i); @@ -34,13 +36,13 @@ fn insert_lookup_remove_robin(load:uint,ops:uint)->u64{ let end = precise_time_ns(); end - start } -fn insert_lookup_remove_hopscotch(load:uint,ops:uint)->u64{ +fn insert_lookup_remove_hopscotch(load:uint,ops:u64)->u64{ let mut m = hopscotch::HashMap::with_capacity(HASHMAP_CAPACITY); for i in range(1,load){ m.insert(i,i+1); } let start = precise_time_ns(); - for i in range(load,load+ops){ + for i in range(load,load+(ops as uint)){ m.insert(i,i+1); for _ in range(0,18){ m.lookup(i); @@ -53,9 +55,11 @@ fn insert_lookup_remove_hopscotch(load:uint,ops:uint)->u64{ fn main(){ // datapoints are the loads 0.3,0.4,0.5,0.6,0.7,0.8,0.9 calculated with 131072 - let data_point:Vec = vec!(9830,11469,13107,14746,16384,18022,19660,21299,22937,24576,26214); - let mut result_hopscotch:Vec = Vec::with_capacity(12); - let mut result_robin:Vec = Vec::with_capacity(12); + //let data_point:Vec = vec!(9830,11469,13107,14746,16384,18022,19660,21299,22937,24576,26214); + //let data_point:Vec = vec!(1229,1434,1638,1843,2048,2253,2458,2662,2867,3072,3277); + let data_point:Vec = vec!(4915,5734,6554,7373,8192,9011,9830,10649,11469,12288,13107); + let mut result_hopscotch:Vec = Vec::with_capacity(12); + let mut result_robin:Vec = Vec::with_capacity(12); let load_factor = vec!(0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8); let mut it = 0; for i in data_point.iter(){ @@ -64,13 +68,15 @@ fn main(){ for _ in range(0,AVG_SIZE){ sum += insert_lookup_remove_hopscotch(*i,OPERATIONS); } - let time_hopscotch = sum/AVG_SIZE; + let sum_milli = (sum as f64)/1000000f64; + let time_hopscotch = (OPERATIONS as f64)/(sum_milli/(AVG_SIZE as f64)); result_hopscotch.push(time_hopscotch); let mut sum2 = 0u64; for _ in range(0,AVG_SIZE){ sum2 += insert_lookup_remove_robin(*i,OPERATIONS); } - let time_robin = sum2/AVG_SIZE; + let sum_milli2 = (sum2 as f64)/1000000f64; + let time_robin = (OPERATIONS as f64)/(sum_milli2/(AVG_SIZE as f64)); result_robin.push(time_robin); it += 1; } diff --git a/test/benchmark-files/bench-resize-conditions80 b/test/benchmark-files/bench-resize-conditions80 new file mode 100755 index 0000000..f479777 Binary files /dev/null and b/test/benchmark-files/bench-resize-conditions80 differ diff --git a/test/benchmark-files/bench-resize-conditions80.rs b/test/benchmark-files/bench-resize-conditions80.rs new file mode 100644 index 0000000..f72c717 --- /dev/null +++ b/test/benchmark-files/bench-resize-conditions80.rs @@ -0,0 +1,80 @@ +#![feature(default_type_params)] +extern crate rand; +extern crate time; +extern crate collections; + +use collections::HashMap; +use time::precise_time_ns; +use std::io::File; + +#[path="../../hashmap/mod.rs"] +mod hopscotch; +#[path="../../hashmap/raw_table/mod.rs"] +mod raw_table; +#[path="../hashers.rs"] +mod hashers; + +fn resize_test(load:uint,table_size:uint,add_range:uint)->bool{ + let mut m = hopscotch::HashMap::with_capacity(table_size); + for i in range(1,load){ + if !m.insert_resize(i,i+1,add_range) { + return true; + } + } + false +} + +fn main(){ + let mut size_4096 = Vec::with_capacity(4); + let mut size_8192 = Vec::with_capacity(4); + let mut size_16384 = Vec::with_capacity(4); + let mut size_32768 = Vec::with_capacity(4); + let add_ranges = vec!(128,256,512); + + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(3277,4096,*ar){ + res += 1; + } + } + size_4096.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(6554,8192,*ar){ + res += 1; + } + } + size_8192.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(13107,16384,*ar){ + res += 1; + } + } + size_16384.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(26214,32768,*ar){ + res += 1; + } + } + size_32768.push(res); + } + let mut file = File::create(&Path::new("output-files/bench-resize-conditions80")); + for i in range(0u,3u){ + let label = add_ranges.get(i).to_str().append(" "); + let s4096 = size_4096.get(i).to_str().append(" "); + let s8192 = size_8192.get(i).to_str().append(" "); + let s16384 = size_16384.get(i).to_str().append(" "); + let s32768 = size_32768.get(i).to_str().append("\n"); + let line = label.into_bytes()+s4096.into_bytes()+s8192.into_bytes()+s16384.into_bytes()+s32768.into_bytes(); + file.write(line.as_slice()); + } +} diff --git a/test/benchmark-files/bench-resize-conditions80.rs~ b/test/benchmark-files/bench-resize-conditions80.rs~ new file mode 100644 index 0000000..f72c717 --- /dev/null +++ b/test/benchmark-files/bench-resize-conditions80.rs~ @@ -0,0 +1,80 @@ +#![feature(default_type_params)] +extern crate rand; +extern crate time; +extern crate collections; + +use collections::HashMap; +use time::precise_time_ns; +use std::io::File; + +#[path="../../hashmap/mod.rs"] +mod hopscotch; +#[path="../../hashmap/raw_table/mod.rs"] +mod raw_table; +#[path="../hashers.rs"] +mod hashers; + +fn resize_test(load:uint,table_size:uint,add_range:uint)->bool{ + let mut m = hopscotch::HashMap::with_capacity(table_size); + for i in range(1,load){ + if !m.insert_resize(i,i+1,add_range) { + return true; + } + } + false +} + +fn main(){ + let mut size_4096 = Vec::with_capacity(4); + let mut size_8192 = Vec::with_capacity(4); + let mut size_16384 = Vec::with_capacity(4); + let mut size_32768 = Vec::with_capacity(4); + let add_ranges = vec!(128,256,512); + + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(3277,4096,*ar){ + res += 1; + } + } + size_4096.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(6554,8192,*ar){ + res += 1; + } + } + size_8192.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(13107,16384,*ar){ + res += 1; + } + } + size_16384.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(26214,32768,*ar){ + res += 1; + } + } + size_32768.push(res); + } + let mut file = File::create(&Path::new("output-files/bench-resize-conditions80")); + for i in range(0u,3u){ + let label = add_ranges.get(i).to_str().append(" "); + let s4096 = size_4096.get(i).to_str().append(" "); + let s8192 = size_8192.get(i).to_str().append(" "); + let s16384 = size_16384.get(i).to_str().append(" "); + let s32768 = size_32768.get(i).to_str().append("\n"); + let line = label.into_bytes()+s4096.into_bytes()+s8192.into_bytes()+s16384.into_bytes()+s32768.into_bytes(); + file.write(line.as_slice()); + } +} diff --git a/test/benchmark-files/bench-resize-conditions85 b/test/benchmark-files/bench-resize-conditions85 new file mode 100755 index 0000000..0673657 Binary files /dev/null and b/test/benchmark-files/bench-resize-conditions85 differ diff --git a/test/benchmark-files/bench-resize-conditions85.rs b/test/benchmark-files/bench-resize-conditions85.rs new file mode 100644 index 0000000..3be3742 --- /dev/null +++ b/test/benchmark-files/bench-resize-conditions85.rs @@ -0,0 +1,80 @@ +#![feature(default_type_params)] +extern crate rand; +extern crate time; +extern crate collections; + +use collections::HashMap; +use time::precise_time_ns; +use std::io::File; + +#[path="../../hashmap/mod.rs"] +mod hopscotch; +#[path="../../hashmap/raw_table/mod.rs"] +mod raw_table; +#[path="../hashers.rs"] +mod hashers; + +fn resize_test(load:uint,table_size:uint,add_range:uint)->bool{ + let mut m = hopscotch::HashMap::with_capacity(table_size); + for i in range(1,load){ + if !m.insert_resize(i,i+1,add_range) { + return true; + } + } + false +} + +fn main(){ + let mut size_4096 = Vec::with_capacity(4); + let mut size_8192 = Vec::with_capacity(4); + let mut size_16384 = Vec::with_capacity(4); + let mut size_32768 = Vec::with_capacity(4); + let add_ranges = vec!(128,256,512); + + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(3482,4096,*ar){ + res += 1; + } + } + size_4096.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(6963,8192,*ar){ + res += 1; + } + } + size_8192.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(13926,16384,*ar){ + res += 1; + } + } + size_16384.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(27853,32768,*ar){ + res += 1; + } + } + size_32768.push(res); + } + let mut file = File::create(&Path::new("output-files/bench-resize-conditions85")); + for i in range(0u,3u){ + let label = add_ranges.get(i).to_str().append(" "); + let s4096 = size_4096.get(i).to_str().append(" "); + let s8192 = size_8192.get(i).to_str().append(" "); + let s16384 = size_16384.get(i).to_str().append(" "); + let s32768 = size_32768.get(i).to_str().append("\n"); + let line = label.into_bytes()+s4096.into_bytes()+s8192.into_bytes()+s16384.into_bytes()+s32768.into_bytes(); + file.write(line.as_slice()); + } +} diff --git a/test/benchmark-files/bench-resize-conditions90 b/test/benchmark-files/bench-resize-conditions90 new file mode 100755 index 0000000..dc4dd20 Binary files /dev/null and b/test/benchmark-files/bench-resize-conditions90 differ diff --git a/test/benchmark-files/bench-resize-conditions90.rs b/test/benchmark-files/bench-resize-conditions90.rs new file mode 100644 index 0000000..1faebd2 --- /dev/null +++ b/test/benchmark-files/bench-resize-conditions90.rs @@ -0,0 +1,80 @@ +#![feature(default_type_params)] +extern crate rand; +extern crate time; +extern crate collections; + +use collections::HashMap; +use time::precise_time_ns; +use std::io::File; + +#[path="../../hashmap/mod.rs"] +mod hopscotch; +#[path="../../hashmap/raw_table/mod.rs"] +mod raw_table; +#[path="../hashers.rs"] +mod hashers; + +fn resize_test(load:uint,table_size:uint,add_range:uint)->bool{ + let mut m = hopscotch::HashMap::with_capacity(table_size); + for i in range(1,load){ + if !m.insert_resize(i,i+1,add_range) { + return true; + } + } + false +} + +fn main(){ + let mut size_4096 = Vec::with_capacity(4); + let mut size_8192 = Vec::with_capacity(4); + let mut size_16384 = Vec::with_capacity(4); + let mut size_32768 = Vec::with_capacity(4); + let add_ranges = vec!(128,256,512); + + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(3686,4096,*ar){ + res += 1; + } + } + size_4096.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(7373,8192,*ar){ + res += 1; + } + } + size_8192.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(14746,16384,*ar){ + res += 1; + } + } + size_16384.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(29491,32768,*ar){ + res += 1; + } + } + size_32768.push(res); + } + let mut file = File::create(&Path::new("output-files/bench-resize-conditions90")); + for i in range(0u,3u){ + let label = add_ranges.get(i).to_str().append(" "); + let s4096 = size_4096.get(i).to_str().append(" "); + let s8192 = size_8192.get(i).to_str().append(" "); + let s16384 = size_16384.get(i).to_str().append(" "); + let s32768 = size_32768.get(i).to_str().append("\n"); + let line = label.into_bytes()+s4096.into_bytes()+s8192.into_bytes()+s16384.into_bytes()+s32768.into_bytes(); + file.write(line.as_slice()); + } +} diff --git a/test/benchmark-files/bench-resize-conditions90.rs~ b/test/benchmark-files/bench-resize-conditions90.rs~ new file mode 100644 index 0000000..f800d1f --- /dev/null +++ b/test/benchmark-files/bench-resize-conditions90.rs~ @@ -0,0 +1,80 @@ +#![feature(default_type_params)] +extern crate rand; +extern crate time; +extern crate collections; + +use collections::HashMap; +use time::precise_time_ns; +use std::io::File; + +#[path="../../hashmap/mod.rs"] +mod hopscotch; +#[path="../../hashmap/raw_table/mod.rs"] +mod raw_table; +#[path="../hashers.rs"] +mod hashers; + +fn resize_test(load:uint,table_size:uint,add_range:uint)->bool{ + let mut m = hopscotch::HashMap::with_capacity(table_size); + for i in range(1,load){ + if !m.insert_resize(i,i+1,add_range) { + return true; + } + } + false +} + +fn main(){ + let mut size_4096 = Vec::with_capacity(4); + let mut size_8192 = Vec::with_capacity(4); + let mut size_16384 = Vec::with_capacity(4); + let mut size_32768 = Vec::with_capacity(4); + let add_ranges = vec!(128,256,512); + + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(3686,4096,*ar){ + res += 1; + } + } + size_4096.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(7373,8192,*ar){ + res += 1; + } + } + size_8192.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(14746,16384,*ar){ + res += 1; + } + } + size_16384.push(res); + } + for ar in add_ranges.iter(){ + let mut res = 0; + for i in range(0,100){ + if resize_test(29491,32768,*ar){ + res += 1; + } + } + size_32768.push(res); + } + let mut file = File::create(&Path::new("output-files/bench-resize-conditions85")); + for i in range(0u,3u){ + let label = add_ranges.get(i).to_str().append(" "); + let s4096 = size_4096.get(i).to_str().append(" "); + let s8192 = size_8192.get(i).to_str().append(" "); + let s16384 = size_16384.get(i).to_str().append(" "); + let s32768 = size_32768.get(i).to_str().append("\n"); + let line = label.into_bytes()+s4096.into_bytes()+s8192.into_bytes()+s16384.into_bytes()+s32768.into_bytes(); + file.write(line.as_slice()); + } +} diff --git a/test/benchmark-files/output-files/bench-60lookup-20insert-20remove b/test/benchmark-files/output-files/bench-60lookup-20insert-20remove index a31f795..acbf016 100644 --- a/test/benchmark-files/output-files/bench-60lookup-20insert-20remove +++ b/test/benchmark-files/output-files/bench-60lookup-20insert-20remove @@ -1,11 +1,11 @@ -0.3 2047288 1591742 -0.35 2106574 1663638 -0.4 2110828 1718794 -0.45 2154866 1808504 -0.5 2187002 1892411 -0.55 2248080 2014610 -0.6 2314493 2208621 -0.65 2409386 2498857 -0.7 2545699 2892771 -0.75 2752639 3457704 -0.8 3108183 4659361 +0.3 246.531572 316.491892 +0.35 247.4411 300.752495 +0.4 238.575935 289.806755 +0.45 235.246404 278.41014 +0.5 229.440049 263.09017 +0.55 225.164046 243.081334 +0.6 216.43367 223.053717 +0.65 203.693152 202.314674 +0.7 203.123033 173.770352 +0.75 177.275029 137.449786 +0.8 159.281774 105.362194 diff --git a/test/benchmark-files/output-files/bench-90lookup-5insert-5remove b/test/benchmark-files/output-files/bench-90lookup-5insert-5remove index 541e9d1..72a07ff 100644 --- a/test/benchmark-files/output-files/bench-90lookup-5insert-5remove +++ b/test/benchmark-files/output-files/bench-90lookup-5insert-5remove @@ -1,11 +1,11 @@ -0.3 5553570 5792808 -0.35 5652988 5916934 -0.4 5738478 6080801 -0.45 5813457 6189191 -0.5 5974991 6422225 -0.55 6193385 6682760 -0.6 6411382 6989873 -0.65 6717898 7485699 -0.7 7128322 8070139 -0.75 7638401 9083327 -0.8 8355344 10570105 +0.3 89.596414 86.732174 +0.35 88.103139 85.470201 +0.4 86.095593 82.916497 +0.45 84.532654 81.177701 +0.5 82.015351 78.072829 +0.55 79.835082 75.201834 +0.6 77.537783 71.352318 +0.65 73.181544 67.795197 +0.7 70.559434 62.229504 +0.75 64.831015 56.162366 +0.8 58.005712 47.859538 diff --git a/test/benchmark-files/output-files/bench-resize-conditions80 b/test/benchmark-files/output-files/bench-resize-conditions80 new file mode 100644 index 0000000..049307e --- /dev/null +++ b/test/benchmark-files/output-files/bench-resize-conditions80 @@ -0,0 +1,3 @@ +128 14 23 35 63 +256 0 0 0 2 +512 0 0 0 0 diff --git a/test/benchmark-files/output-files/bench-resize-conditions85 b/test/benchmark-files/output-files/bench-resize-conditions85 new file mode 100644 index 0000000..97be124 --- /dev/null +++ b/test/benchmark-files/output-files/bench-resize-conditions85 @@ -0,0 +1,3 @@ +128 50 79 98 100 +256 4 7 19 40 +512 0 0 0 0 diff --git a/test/benchmark-files/output-files/bench-resize-conditions90 b/test/benchmark-files/output-files/bench-resize-conditions90 new file mode 100644 index 0000000..2eb0f30 --- /dev/null +++ b/test/benchmark-files/output-files/bench-resize-conditions90 @@ -0,0 +1,3 @@ +128 98 100 100 100 +256 38 69 93 100 +512 5 8 26 40 diff --git a/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.png b/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.png index c09f74c..8c2d014 100644 Binary files a/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.png and b/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.png differ diff --git a/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.sh b/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.sh index 89a8c61..77bb126 100755 --- a/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.sh +++ b/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.sh @@ -5,5 +5,10 @@ set output "plot-60lookup-20insert-20remove.png" set title "60% lookup 20% insert 20% remove benchmark" set xlabel "Load factor" set ylabel "Time (ns)" -plot "bench-60lookup-20insert-20remove" u 1:2 t 'hopscotch' w linespoints, "bench-60lookup-20insert-20remove" u 1:3 w linespoints t 'robin hood' +set xtics 0.25,.05,0.85 +set xrange [0.25:0.85] +set mxtics 1 +set mytics 5 +set grid mxtics mytics +plot "bench-60lookup-20insert-20remove" u 1:2 t 'hopscotch' w linespoints lw 2, "bench-60lookup-20insert-20remove" u 1:3 w linespoints t 'robin hood' lw 2 __EOF diff --git a/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.sh~ b/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.sh~ index 3147ffb..24267c9 100755 --- a/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.sh~ +++ b/test/benchmark-files/output-files/plot-60lookup-20insert-20remove.sh~ @@ -1,9 +1,14 @@ #/bin/bash /usr/bin/gnuplot <<\__EOF set term png -set output "plot-insert-same-bucket.png" -set title "Insert into same bucket benchmark" -set xlabel "Nr. of inserts" +set output "plot-60lookup-20insert-20remove.png" +set title "60% lookup 20% insert 20% remove benchmark" +set xlabel "Load factor" set ylabel "Time (ns)" -plot "bench-insert-same-bucket" u 1:2 t 'hopscotch' w linespoints, "bench-insert-same-bucket" u 1:3 w linespoints t 'robin hood' +set xtics 0.25,.05,0.85 +set xrange [0.25:0.85] +set mxtics 1 +set mytics 4 +set grid mxtics mytics +plot "bench-60lookup-20insert-20remove" u 1:2 t 'hopscotch' w linespoints lw 2, "bench-60lookup-20insert-20remove" u 1:3 w linespoints t 'robin hood' lw 2 __EOF diff --git a/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.png b/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.png index fa10c39..b86cc3d 100644 Binary files a/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.png and b/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.png differ diff --git a/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.sh b/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.sh index fca0503..964ed29 100755 --- a/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.sh +++ b/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.sh @@ -4,6 +4,11 @@ set term png set output "plot-90lookup-5insert-5remove.png" set title "90% lookup 5% insert 5% remove benchmark" set xlabel "Load factor" -set ylabel "Time (ns)" -plot "bench-90lookup-5insert-5remove" u 1:2 t 'hopscotch' w linespoints, "bench-90lookup-5insert-5remove" u 1:3 w linespoints t 'robin hood' +set ylabel "ops / ms" +set xtics 0.25,.05,0.85 +set xrange [0.25:0.85] +set mxtics 1 +set mytics 4 +set grid mxtics mytics +plot "bench-90lookup-5insert-5remove" u 1:2 t 'hopscotch' w linespoints lw 2, "bench-90lookup-5insert-5remove" u 1:3 w linespoints t 'robin hood' lw 2 __EOF diff --git a/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.sh~ b/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.sh~ index 89a8c61..3ec500a 100755 --- a/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.sh~ +++ b/test/benchmark-files/output-files/plot-90lookup-5insert-5remove.sh~ @@ -1,9 +1,14 @@ #/bin/bash /usr/bin/gnuplot <<\__EOF set term png -set output "plot-60lookup-20insert-20remove.png" -set title "60% lookup 20% insert 20% remove benchmark" +set output "plot-90lookup-5insert-5remove.png" +set title "90% lookup 5% insert 5% remove benchmark" set xlabel "Load factor" -set ylabel "Time (ns)" -plot "bench-60lookup-20insert-20remove" u 1:2 t 'hopscotch' w linespoints, "bench-60lookup-20insert-20remove" u 1:3 w linespoints t 'robin hood' +set ylabel "ops/ms" +set xtics 0.25,.05,0.85 +set xrange [0.25:0.85] +set mxtics 1 +set mytics 4 +set grid mxtics mytics +plot "bench-90lookup-5insert-5remove" u 1:2 t 'hopscotch' w linespoints lw 2, "bench-90lookup-5insert-5remove" u 1:3 w linespoints t 'robin hood' lw 2 __EOF diff --git a/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.png b/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.png index 85498fc..c9035ce 100644 Binary files a/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.png and b/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.png differ diff --git a/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.sh b/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.sh index 4810803..32ad3b0 100755 --- a/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.sh +++ b/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.sh @@ -5,5 +5,8 @@ set output "plot-insert-lookup-same-bucket.png" set title "Insert and lookup into same bucket benchmark" set xlabel "Nr. of operations" set ylabel "Time (ns)" -plot "bench-insert-lookup-same-bucket" u 1:2 t 'hopscotch insert' w linespoints, "bench-insert-lookup-same-bucket" u 1:3 w linespoints t 'robin hood insert', "bench-insert-lookup-same-bucket" u 1:4 t 'hopscotch lookup' w linespoints, "bench-insert-lookup-same-bucket" u 1:5 t 'robin hood lookup' w linespoints +set mxtics 1 +set mytics 4 +set grid mxtics mytics +plot "bench-insert-lookup-same-bucket" u 1:2 t 'hopscotch insert' w linespoints lw 2, "bench-insert-lookup-same-bucket" u 1:3 w linespoints t 'robin hood insert' lw 2, "bench-insert-lookup-same-bucket" u 1:4 t 'hopscotch lookup' w linespoints lw 2, "bench-insert-lookup-same-bucket" u 1:5 t 'robin hood lookup' w linespoints lw 2 __EOF diff --git a/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.sh~ b/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.sh~ index 3147ffb..4632ad4 100755 --- a/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.sh~ +++ b/test/benchmark-files/output-files/plot-insert-lookup-same-bucket.sh~ @@ -1,9 +1,9 @@ #/bin/bash /usr/bin/gnuplot <<\__EOF set term png -set output "plot-insert-same-bucket.png" -set title "Insert into same bucket benchmark" -set xlabel "Nr. of inserts" +set output "plot-insert-lookup-same-bucket.png" +set title "Insert and lookup into same bucket benchmark" +set xlabel "Nr. of operations" set ylabel "Time (ns)" -plot "bench-insert-same-bucket" u 1:2 t 'hopscotch' w linespoints, "bench-insert-same-bucket" u 1:3 w linespoints t 'robin hood' +plot "bench-insert-lookup-same-bucket" u 1:2 t 'hopscotch insert' w linespoints lw 2, "bench-insert-lookup-same-bucket" u 1:3 w linespoints t 'robin hood insert' lw 2, "bench-insert-lookup-same-bucket" u 1:4 t 'hopscotch lookup' w linespoints lw 2, "bench-insert-lookup-same-bucket" u 1:5 t 'robin hood lookup' w linespoints lw 2 __EOF diff --git a/test/benchmark-files/output-files/plot-resize-conditions.sh~ b/test/benchmark-files/output-files/plot-resize-conditions.sh~ new file mode 100755 index 0000000..035294c --- /dev/null +++ b/test/benchmark-files/output-files/plot-resize-conditions.sh~ @@ -0,0 +1,11 @@ +#/bin/bash +/usr/bin/gnuplot <<\__EOF +set term png +set output "plot-resize-conditions.png" +set title "Resize % with different add ranges and table sizes" +set xlabel "Add range" +set ylabel "Resize %" +set style data histogram gap 1 +set style fill solid border -1 +set boxwidth 0.9 +plot 'bench-resize-conditions' using 2:xtic(1), 'bench-resize-conditions' using 3:xtic(1), 'bench-resize-conditions' using 4:xtic(1) diff --git a/test/benchmark-files/output-files/plot-resize-conditions80.png b/test/benchmark-files/output-files/plot-resize-conditions80.png new file mode 100644 index 0000000..2c2d98f Binary files /dev/null and b/test/benchmark-files/output-files/plot-resize-conditions80.png differ diff --git a/test/benchmark-files/output-files/plot-resize-conditions80.sh b/test/benchmark-files/output-files/plot-resize-conditions80.sh new file mode 100755 index 0000000..99b5fd5 --- /dev/null +++ b/test/benchmark-files/output-files/plot-resize-conditions80.sh @@ -0,0 +1,11 @@ +#/bin/bash +/usr/bin/gnuplot <<\__EOF +set term png +set output "plot-resize-conditions80.png" +set title "Resize % with different add ranges and table sizes" +set xlabel "Add range" +set ylabel "Resize %" +set style data histogram gap 1 +set style fill solid border -1 +set boxwidth 0.9 +plot 'bench-resize-conditions80' using 2:xtic(1) title 'size 4096', 'bench-resize-conditions80' using 3:xtic(1) title 'size 8192', 'bench-resize-conditions80' using 4:xtic(1) title 'size 16384', 'bench-resize-conditions80' using 5:xtic(1) title 'size 32768' diff --git a/test/benchmark-files/output-files/plot-resize-conditions80.sh~ b/test/benchmark-files/output-files/plot-resize-conditions80.sh~ new file mode 100755 index 0000000..55440de --- /dev/null +++ b/test/benchmark-files/output-files/plot-resize-conditions80.sh~ @@ -0,0 +1,11 @@ +#/bin/bash +/usr/bin/gnuplot <<\__EOF +set term png +set output "plot-resize-conditions85.png" +set title "Resize % with different add ranges and table sizes" +set xlabel "Add range" +set ylabel "Resize %" +set style data histogram gap 1 +set style fill solid border -1 +set boxwidth 0.9 +plot 'bench-resize-conditions85' using 2:xtic(1) title 'size 4096', 'bench-resize-conditions85' using 3:xtic(1) title 'size 8192', 'bench-resize-conditions85' using 4:xtic(1) title 'size 16384', 'bench-resize-conditions85' using 5:xtic(1) title 'size 32768' diff --git a/test/benchmark-files/output-files/plot-resize-conditions85.png b/test/benchmark-files/output-files/plot-resize-conditions85.png new file mode 100644 index 0000000..978ea0e Binary files /dev/null and b/test/benchmark-files/output-files/plot-resize-conditions85.png differ diff --git a/test/benchmark-files/output-files/plot-resize-conditions85.sh b/test/benchmark-files/output-files/plot-resize-conditions85.sh new file mode 100755 index 0000000..55440de --- /dev/null +++ b/test/benchmark-files/output-files/plot-resize-conditions85.sh @@ -0,0 +1,11 @@ +#/bin/bash +/usr/bin/gnuplot <<\__EOF +set term png +set output "plot-resize-conditions85.png" +set title "Resize % with different add ranges and table sizes" +set xlabel "Add range" +set ylabel "Resize %" +set style data histogram gap 1 +set style fill solid border -1 +set boxwidth 0.9 +plot 'bench-resize-conditions85' using 2:xtic(1) title 'size 4096', 'bench-resize-conditions85' using 3:xtic(1) title 'size 8192', 'bench-resize-conditions85' using 4:xtic(1) title 'size 16384', 'bench-resize-conditions85' using 5:xtic(1) title 'size 32768' diff --git a/test/benchmark-files/output-files/plot-resize-conditions85.sh~ b/test/benchmark-files/output-files/plot-resize-conditions85.sh~ new file mode 100755 index 0000000..59f81dc --- /dev/null +++ b/test/benchmark-files/output-files/plot-resize-conditions85.sh~ @@ -0,0 +1,11 @@ +#/bin/bash +/usr/bin/gnuplot <<\__EOF +set term png +set output "plot-resize-conditions.png" +set title "Resize % with different add ranges and table sizes" +set xlabel "Add range" +set ylabel "Resize %" +set style data histogram gap 1 +set style fill solid border -1 +set boxwidth 0.9 +plot 'bench-resize-conditions85' using 2:xtic(1) title 'size 4096', 'bench-resize-conditions85' using 3:xtic(1) title 'size 8192', 'bench-resize-conditions85' using 4:xtic(1) title 'size 16384', 'bench-resize-conditions85' using 5:xtic(1) title 'size 32768' diff --git a/test/benchmark-files/output-files/plot-resize-conditions90.png b/test/benchmark-files/output-files/plot-resize-conditions90.png new file mode 100644 index 0000000..ec5a5dd Binary files /dev/null and b/test/benchmark-files/output-files/plot-resize-conditions90.png differ diff --git a/test/benchmark-files/output-files/plot-resize-conditions90.sh b/test/benchmark-files/output-files/plot-resize-conditions90.sh new file mode 100755 index 0000000..ca78817 --- /dev/null +++ b/test/benchmark-files/output-files/plot-resize-conditions90.sh @@ -0,0 +1,11 @@ +#/bin/bash +/usr/bin/gnuplot <<\__EOF +set term png +set output "plot-resize-conditions90.png" +set title "Resize % with different add ranges and table sizes" +set xlabel "Add range" +set ylabel "Resize %" +set style data histogram gap 1 +set style fill solid border -1 +set boxwidth 0.9 +plot 'bench-resize-conditions90' using 2:xtic(1) title 'size 4096', 'bench-resize-conditions90' using 3:xtic(1) title 'size 8192', 'bench-resize-conditions90' using 4:xtic(1) title 'size 16384', 'bench-resize-conditions90' using 5:xtic(1) title 'size 32768' diff --git a/test/benchmark-files/output-files/plot-resize-conditions90.sh~ b/test/benchmark-files/output-files/plot-resize-conditions90.sh~ new file mode 100755 index 0000000..55440de --- /dev/null +++ b/test/benchmark-files/output-files/plot-resize-conditions90.sh~ @@ -0,0 +1,11 @@ +#/bin/bash +/usr/bin/gnuplot <<\__EOF +set term png +set output "plot-resize-conditions85.png" +set title "Resize % with different add ranges and table sizes" +set xlabel "Add range" +set ylabel "Resize %" +set style data histogram gap 1 +set style fill solid border -1 +set boxwidth 0.9 +plot 'bench-resize-conditions85' using 2:xtic(1) title 'size 4096', 'bench-resize-conditions85' using 3:xtic(1) title 'size 8192', 'bench-resize-conditions85' using 4:xtic(1) title 'size 16384', 'bench-resize-conditions85' using 5:xtic(1) title 'size 32768'