From 9a1f7cfced2f791d344f35c8f1ff34fb8b0ea1ee Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 23 May 2014 17:36:47 +0800 Subject: [PATCH] update benchmark records --- bench.html | 14 ++++++++++++++ bench_str.csv | 18 ++++++++++++++++++ src/node.c | 2 +- tests/bench.c | 16 ++++++++++++---- 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/bench.html b/bench.html index 9b62e96..586f756 100644 --- a/bench.html +++ b/bench.html @@ -131,6 +131,17 @@ }, pointStart: Date.UTC(2014, 5, 16), data: [] + }, + { + type: 'area', + name: 'match_entry with str', + pointInterval: 1000, + lineWidth: 1, + marker: { + radius: 3 + }, + pointStart: Date.UTC(2014, 5, 16), + data: [] } ] }; @@ -147,6 +158,9 @@ a = parseInt(columns[3]); options.series[2].data.push(a || 0); + + a = parseInt(columns[4]); + options.series[3].data.push(a || 0); }); $('#chart').highcharts(options); diff --git a/bench_str.csv b/bench_str.csv index e187eef..ef3b414 100644 --- a/bench_str.csv +++ b/bench_str.csv @@ -493,3 +493,21 @@ 1400833024,11715363.55,4726544.41,59074.70 1400833045,11813359.08,4828190.72,53092.46 1400833051,11082009.03,4721512.49,62601.55 +1400837359,2709622.75,4773140.52,71089.90 +1400837501,11958680.82,4777890.52,45590.26 +1400837621,11423775.75,4679207.46,59074.70,2459430.07 +1400837636,11534281.98,4192617.73,66576.25,2968590.57 +1400837657,11693260.66,4815393.82,77672.30,2856236.96 +1400837667,11834338.05,4822006.81,47662.55,3015821.63 +1400837677,11999462.15,4854783.73,49932.19,3008349.32 +1400837696,11814938.63,4740948.30,55188.21,3007002.06 +1400837706,11535595.30,4712420.14,62601.55,2865728.03 +1400837716,11928552.18,4833449.01,35848.75,2990344.18 +1400837725,11873673.72,4275934.73,45590.26,3024045.98 +1400837735,11805064.50,4855078.95,47662.55,3016256.98 +1400837744,12041094.07,4815428.09,61680.94,2991090.14 +1400837754,11766504.83,4848425.07,47662.55,2986385.66 +1400837764,11979089.24,4257134.48,47662.55,3015693.70 +1400837774,11190990.08,4331119.44,45590.26,2587281.10 +1400837785,10306507.50,3909290.89,47662.55,2827471.10 +1400837797,10323334.38,4221122.48,55924.05,2294463.55 diff --git a/src/node.c b/src/node.c index 444e739..91e254a 100644 --- a/src/node.c +++ b/src/node.c @@ -1,4 +1,4 @@ -#include +#include "config.h" #include #include #include diff --git a/tests/bench.c b/tests/bench.c index b92cd89..00d7ad1 100644 --- a/tests/bench.c +++ b/tests/bench.c @@ -450,10 +450,18 @@ r3_tree_insert_path(n, "/garply/grault/corge", NULL); assert( *((int*) m->data) == 999 ); - BENCHMARK(string_dispatch) + + BENCHMARK(str_dispatch) r3_tree_matchl(n , "/qux/bar/corge", strlen("/qux/bar/corge"), NULL); - END_BENCHMARK(string_dispatch) - BENCHMARK_SUMMARY(string_dispatch); + END_BENCHMARK(str_dispatch) + BENCHMARK_SUMMARY(str_dispatch); + + BENCHMARK(str_match_entry) + match_entry * e = match_entry_createl("/qux/bar/corge", strlen("/qux/bar/corge") ); + r3_tree_match_entry(n , e); + zfree(e); + END_BENCHMARK(str_match_entry) + BENCHMARK_SUMMARY(str_match_entry); node * tree2 = r3_tree_create(1); @@ -465,6 +473,6 @@ r3_tree_insert_path(n, "/garply/grault/corge", NULL); END_BENCHMARK(pcre_dispatch) BENCHMARK_SUMMARY(pcre_dispatch); - BENCHMARK_RECORD_CSV("bench_str.csv", 3, BR(string_dispatch), BR(pcre_dispatch), BR(tree_compile) ); + BENCHMARK_RECORD_CSV("bench_str.csv", 4, BR(str_dispatch), BR(pcre_dispatch), BR(tree_compile), BR(str_match_entry) ); return 0; }