Skip to content
Browse files

Fixed benchmarks after rename

  • Loading branch information...
1 parent 2fa738d commit cef669dff88f0cd72cd20574a192533b93ee8e85 @tj tj committed Nov 27, 2010
Showing with 27 additions and 27 deletions.
  1. +27 −27 benchmark.c
View
54 benchmark.c
@@ -28,9 +28,9 @@ static void
bm_push() {
start();
int n = nnodes;
- List *list = List_new();
+ list_t *list = list_new();
while (n--) {
- List_push(list, ListNode_new("foo"));
+ list_push(list, list_node_new("foo"));
}
stop();
}
@@ -39,97 +39,97 @@ static void
bm_unshift() {
start();
int n = nnodes;
- List *list = List_new();
+ list_t *list = list_new();
while (n--) {
- List_unshift(list, ListNode_new("foo"));
+ list_unshift(list, list_node_new("foo"));
}
stop();
}
static void
bm_find() {
int n = nnodes;
- List *list = List_new();
+ list_t *list = list_new();
while (n--) {
- List_unshift(list, ListNode_new("foo"));
+ list_unshift(list, list_node_new("foo"));
}
- List_push(list, ListNode_new("bar"));
+ list_push(list, list_node_new("bar"));
start();
- List_find(list, "bar");
+ list_find(list, "bar");
stop();
}
static void
bm_iterate() {
int n = nnodes;
- List *list = List_new();
+ list_t *list = list_new();
while (n--) {
- List_unshift(list, ListNode_new("foo"));
+ list_unshift(list, list_node_new("foo"));
}
- ListIterator *it = ListIterator_new(list, LIST_HEAD);
- ListNode *node;
+ list_iterator_t *it = list_iterator_new(list, LIST_HEAD);
+ list_node_t *node;
start();
- while ((node = ListIterator_next(it)))
+ while ((node = list_iterator_next(it)))
;
stop();
}
static void
bm_pop() {
int n = nnodes;
- List *list = List_new();
+ list_t *list = list_new();
while (n--) {
- List_unshift(list, ListNode_new("foo"));
+ list_unshift(list, list_node_new("foo"));
}
- ListNode *node;
+ list_node_t *node;
start();
- while ((node = List_pop(list)))
+ while ((node = list_pop(list)))
;
stop();
}
static void
bm_shift() {
int n = nnodes;
- List *list = List_new();
+ list_t *list = list_new();
while (n--) {
- List_unshift(list, ListNode_new("foo"));
+ list_unshift(list, list_node_new("foo"));
}
- ListNode *node;
+ list_node_t *node;
start();
- while ((node = List_shift(list)))
+ while ((node = list_shift(list)))
;
stop();
}
-static List *list;
+static list_t *list;
static void
bm_at() {
start();
- List_at(list, 100000);
+ list_at(list, 100000);
stop();
}
static void
bm_at2() {
start();
- List_at(list, 1000000);
+ list_at(list, 1000000);
stop();
}
static void
bm_at3() {
start();
- List_at(list, -100000);
+ list_at(list, -100000);
stop();
}
int
main(int argc, const char **argv){
int n = nnodes;
- list = List_new();
- while (n--) List_unshift(list, ListNode_new("foo"));
+ list = list_new();
+ while (n--) list_unshift(list, list_node_new("foo"));
puts("\n 10,000,000 nodes\n");
bm("pushed", bm_push);
bm("unshifted", bm_unshift);

0 comments on commit cef669d

Please sign in to comment.
Something went wrong with that request. Please try again.