-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
95 additions
and
185 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,46 +1,15 @@ | ||
Ran on macbook. | ||
Ran on Macbook. | ||
|
||
``` | ||
BenchmarkWrite/branch_2-4 1000000 44162 ns/op | ||
BenchmarkWrite/branch_3-4 1000000 6306 ns/op | ||
BenchmarkWrite/branch_4-4 1000000 6922 ns/op | ||
BenchmarkWrite/branch_5-4 1000000 9222 ns/op | ||
BenchmarkWrite/branch_6-4 1000000 7646 ns/op | ||
BenchmarkWrite/branch_7-4 500000 6604 ns/op | ||
BenchmarkWriteParallel/branch_2-4 500000 24437 ns/op | ||
BenchmarkWriteParallel/branch_3-4 1000000 7390 ns/op | ||
BenchmarkWriteParallel/branch_4-4 1000000 8112 ns/op | ||
BenchmarkWriteParallel/branch_5-4 500000 7885 ns/op | ||
BenchmarkWriteParallel/branch_6-4 500000 8459 ns/op | ||
BenchmarkWriteParallel/branch_7-4 500000 8593 ns/op | ||
BenchmarkRead/branch_2-4 200000 8491 ns/op | ||
BenchmarkRead/branch_3-4 500000 3108 ns/op | ||
BenchmarkRead/branch_4-4 500000 3223 ns/op | ||
BenchmarkRead/branch_5-4 500000 3586 ns/op | ||
BenchmarkRead/branch_6-4 500000 4118 ns/op | ||
BenchmarkRead/branch_7-4 300000 4729 ns/op | ||
BenchmarkReadParallel/branch_2-4 500000 2680 ns/op | ||
BenchmarkReadParallel/branch_3-4 1000000 1909 ns/op | ||
BenchmarkReadParallel/branch_4-4 1000000 1928 ns/op | ||
BenchmarkReadParallel/branch_5-4 1000000 1663 ns/op | ||
BenchmarkReadParallel/branch_6-4 1000000 1400 ns/op | ||
BenchmarkReadParallel/branch_7-4 1000000 1733 ns/op | ||
BenchmarkReadWrite/frac_0-4 1000000 6719 ns/op | ||
BenchmarkReadWrite/frac_1-4 1000000 6177 ns/op | ||
BenchmarkReadWrite/frac_2-4 1000000 6239 ns/op | ||
BenchmarkReadWrite/frac_3-4 1000000 5616 ns/op | ||
BenchmarkReadWrite/frac_4-4 1000000 5103 ns/op | ||
BenchmarkReadWrite/frac_5-4 1000000 4962 ns/op | ||
BenchmarkReadWrite/frac_6-4 1000000 4172 ns/op | ||
BenchmarkReadWrite/frac_7-4 1000000 3175 ns/op | ||
BenchmarkReadWrite/frac_8-4 1000000 2070 ns/op | ||
BenchmarkReadWrite/frac_9-4 1000000 1201 ns/op | ||
BenchmarkReadWrite/frac_10-4 5000000 456 ns/o | ||
``` | ||
|
||
For comparison with lock-free skiplist | ||
|
||
``` | ||
BenchmarkReadParallel/branch_4-4 1000000 1358 ns/op | ||
BenchmarkWriteParallelAlt-4 100 19644625 ns/op | ||
BenchmarkReadWrite/frac_0-4 500000 7073 ns/op | ||
BenchmarkReadWrite/frac_1-4 1000000 8509 ns/op | ||
BenchmarkReadWrite/frac_2-4 1000000 7978 ns/op | ||
BenchmarkReadWrite/frac_3-4 500000 5832 ns/op | ||
BenchmarkReadWrite/frac_4-4 1000000 5714 ns/op | ||
BenchmarkReadWrite/frac_5-4 1000000 5011 ns/op | ||
BenchmarkReadWrite/frac_6-4 1000000 4417 ns/op | ||
BenchmarkReadWrite/frac_7-4 1000000 3434 ns/op | ||
BenchmarkReadWrite/frac_8-4 1000000 2393 ns/op | ||
BenchmarkReadWrite/frac_9-4 1000000 1437 ns/op | ||
BenchmarkReadWrite/frac_10-4 3000000 483 ns/op | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,31 @@ | ||
This is better than `skiplist` and `slist`. | ||
This is much better than `skiplist` and `slist`. | ||
|
||
WriteParallel is about 3X faster and ReadParallel is 2X faster than `skiplist` and 20X faster | ||
than `slist`. | ||
``` | ||
BenchmarkReadWrite/frac_0-4 1000000 1516 ns/op | ||
BenchmarkReadWrite/frac_1-4 1000000 1456 ns/op | ||
BenchmarkReadWrite/frac_2-4 1000000 1354 ns/op | ||
BenchmarkReadWrite/frac_3-4 1000000 1295 ns/op | ||
BenchmarkReadWrite/frac_4-4 1000000 1142 ns/op | ||
BenchmarkReadWrite/frac_5-4 1000000 1077 ns/op | ||
BenchmarkReadWrite/frac_6-4 1000000 1003 ns/op | ||
BenchmarkReadWrite/frac_7-4 2000000 1054 ns/op | ||
BenchmarkReadWrite/frac_8-4 2000000 929 ns/op | ||
BenchmarkReadWrite/frac_9-4 3000000 815 ns/op | ||
BenchmarkReadWrite/frac_10-4 5000000 472 ns/op | ||
``` | ||
|
||
But compared to a simple map with read-write lock, it is still slower. | ||
|
||
``` | ||
BenchmarkWriteParallelAlt-4 200 7700008 ns/op | ||
BenchmarkReadParallel-4 2000000 787 ns/op | ||
BenchmarkReadWriteMap/frac_0-4 2000000 883 ns/op | ||
BenchmarkReadWriteMap/frac_1-4 2000000 830 ns/op | ||
BenchmarkReadWriteMap/frac_2-4 2000000 658 ns/op | ||
BenchmarkReadWriteMap/frac_3-4 2000000 662 ns/op | ||
BenchmarkReadWriteMap/frac_4-4 2000000 657 ns/op | ||
BenchmarkReadWriteMap/frac_5-4 2000000 650 ns/op | ||
BenchmarkReadWriteMap/frac_6-4 3000000 592 ns/op | ||
BenchmarkReadWriteMap/frac_7-4 3000000 573 ns/op | ||
BenchmarkReadWriteMap/frac_8-4 3000000 539 ns/op | ||
BenchmarkReadWriteMap/frac_9-4 3000000 521 ns/op | ||
BenchmarkReadWriteMap/frac_10-4 3000000 479 ns/op | ||
``` |
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