Permalink
Browse files

Add a simple test for checking the lookup time of a Succinctly-stored…

… Trie.
  • Loading branch information...
1 parent 8a3912b commit 0093a59d3c6c302dfee6df107241442ce17af591 @jeresig committed Mar 22, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 lookup.html
View
@@ -0,0 +1,17 @@
+<script src="Bits.js"></script>
+<script>
+window.onload = function() {
+ var xhr = new XMLHttpRequest();
+ xhr.open( "GET", "dict/succinct.txt", false );
+ xhr.send( null );
+
+ var parts = xhr.responseText.split(",");
+ var dict = new FrozenTrie( parts[2], parts[1], parts[0] );
+
+ var start = (new Date).getTime();
+ for ( var i = 0, l = 100; i < l; i++ ) {
+ dict.lookup( "test" );
+ }
+ alert( (new Date).getTime() - start );
+};
+</script>

0 comments on commit 0093a59

Please sign in to comment.