-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements string indexing. Closes #9 (again)
- Loading branch information
Showing
7 changed files
with
109 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,3 @@ | ||
|
||
// Without optimizations: | ||
// Number of runs: 100 | ||
// Mean time: 74276.98325 µs | ||
// Mean #instructions: 1122 | ||
// Mean #stalls: 0 | ||
// Mean instruction/s: 15105.621565480044 | ||
|
||
// With string-copy-removal: | ||
// Number of runs: 100 | ||
// Mean time: 19746.62485 µs | ||
// Mean #instructions: 1122 | ||
// Mean #stalls: 0 | ||
// Mean instruction/s: 56819.83673275689 | ||
|
||
// Make clone() return a refcounted string instead of a flat clone: | ||
// Number of runs: 100 | ||
// Mean time: 17273.46292 µs | ||
// Mean #instructions: 1122 | ||
// Mean #stalls: 0 | ||
// Mean instruction/s: 64955.128291090805 | ||
|
||
function dump(str) { } | ||
|
||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
dump("hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello"); | ||
|
||
var deep_copy = [ | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ], | ||
[ "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello", "hello" ] | ||
]; | ||
|
||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
dump(deep_copy, deep_copy, deep_copy, deep_copy, deep_copy, deep_copy); | ||
var x = "a"; | ||
x[0] = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.