prefetch firstbyte

This commit is contained in:
c9s 2014-05-21 01:20:18 +08:00
parent e9797295b5
commit 0d2ae75bc2
2 changed files with 7 additions and 2 deletions

View file

@ -345,9 +345,9 @@ route * r3_tree_match_route(node *tree, match_entry * entry) {
inline edge * r3_node_find_edge_str(node * n, char * str, int str_len) { inline edge * r3_node_find_edge_str(node * n, char * str, int str_len) {
int i = 0; int i = 0;
int matched_idx = 0; int matched_idx = 0;
char firstbyte = *str;
for (; i < n->edge_len ; i++ ) { for (; i < n->edge_len ; i++ ) {
if ( *str == *(n->edges[i]->pattern) ) { if ( firstbyte == *(n->edges[i]->pattern) ) {
matched_idx = i; matched_idx = i;
break; break;
} }

View file

@ -423,3 +423,8 @@
1400605834,13635682.11 1400605834,13635682.11
1400606038,13788132.68 1400606038,13788132.68
1400606140,13834040.49 1400606140,13834040.49
1400606400,13665833.66
1400606404,13519944.18
1400606406,13923000.83
1400606409,13742645.62
1400606411,13878225.03

1 1400242718 5649455.80
423 1400605834 13635682.11
424 1400606038 13788132.68
425 1400606140 13834040.49
426 1400606400 13665833.66
427 1400606404 13519944.18
428 1400606406 13923000.83
429 1400606409 13742645.62
430 1400606411 13878225.03