Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2307)

Unified Diff: benchmarks/splay.js

Issue 2086005: Incorporate feedback from issue 679 and issue 690 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « benchmarks/run.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: benchmarks/splay.js
===================================================================
--- benchmarks/splay.js (revision 4657)
+++ benchmarks/splay.js (working copy)
@@ -46,16 +46,16 @@
var splayTree = null;
-function GeneratePayloadTree(depth, key) {
+function GeneratePayloadTree(depth, tag) {
if (depth == 0) {
return {
array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
- string : 'String for key ' + key + ' in leaf node'
+ string : 'String for key ' + tag + ' in leaf node'
};
} else {
return {
- left: GeneratePayloadTree(depth - 1, key),
- right: GeneratePayloadTree(depth - 1, key)
+ left: GeneratePayloadTree(depth - 1, tag),
+ right: GeneratePayloadTree(depth - 1, tag)
};
}
}
@@ -74,7 +74,8 @@
do {
key = GenerateKey();
} while (splayTree.find(key) != null);
- splayTree.insert(key, GeneratePayloadTree(kSplayTreePayloadDepth, key));
+ var payload = GeneratePayloadTree(kSplayTreePayloadDepth, String(key));
+ splayTree.insert(key, payload);
return key;
}
« no previous file with comments | « benchmarks/run.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698