Skip to content

Commit

Permalink
force blind puts into non-empty key range
Browse files Browse the repository at this point in the history
The insert workload is randomized, so the blind puts were computed but nothing
was actually written blindly.

benchmark                                 old ns/op     new ns/op     delta
BenchmarkTrackChoices1280_Cockroach-8     171532        65505         -61.81%

benchmark                                 old allocs     new allocs     delta
BenchmarkTrackChoices1280_Cockroach-8     142            130            -8.45%

benchmark                                 old bytes     new bytes     delta
BenchmarkTrackChoices1280_Cockroach-8     27241         26018         -4.49%

```
2016/05/10 20:15:44.886244	0.006944	node 1
20:15:44.886246	 .     3	... node 1
20:15:44.886253	 .     6	... read has no clock uncertainty
20:15:44.886334	 .    81	... executing 1282 requests
20:15:44.886543	 .   209	... read-write path
20:15:44.886544	 .     1	... command queue
20:15:44.886963	 .   420	... left command queue
20:15:44.886966	 .     3	... request leader lease (attempt cockroachdb#1)
20:15:44.887265	 .   298	... prep for ts cache
20:15:44.887266	 .     1	... applied ts cache
20:15:44.887268	 .     2	... start marshal
20:15:44.887772	 .   504	... end marshal
20:15:44.887835	 .    63	... begin prop
20:15:44.887852	 .    17	... done prop
20:15:44.887855	 .     3	... proposed to Raft
20:15:44.888949	 .  1094	... applying batch
20:15:44.889015	 .    67	... checked aborted txn
20:15:44.889197	 .   181	... checked leadership
20:15:44.889199	 .     2	... executing as 1PC txn
20:15:44.889644	 .   445	... 1280 blind puts
20:15:44.892245	 .  2601	... executeBatch returns
20:15:44.892308	 .    63	... executed batch
20:15:44.892360	 .    52	... prep for commit
20:15:44.893101	 .   741	... committed
20:15:44.893154	 .    53	... processed async intents
20:15:44.893155	 .     1	... applied batch
20:15:44.893173	 .    18	... response obtained
20:15:44.893174	 .     1	... endCmds begins
20:15:44.893175	 .     1	... begin update tsCache
20:15:44.893176	 .     1	... end update tsCache
20:15:44.893177	 .     2	... removed from cmdQ
20:15:44.893178	 .     1	... endCmds ends
20:15:44.893180	 .     1	... Send returns
```
  • Loading branch information
tbg authored and Cuong Do committed May 19, 2016
1 parent 70a3e12 commit cf89e30
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions out.allblind.10s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PASS
BenchmarkTrackChoices1280_Cockroach-8 200000 65505 ns/op 26018 B/op 130 allocs/op
ok github.com/cockroachdb/cockroach/sql 14.236s
3 changes: 3 additions & 0 deletions out.allblind.1s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PASS
BenchmarkTrackChoices1280_Cockroach-8 20000 63429 ns/op 26003 B/op 130 allocs/op
ok github.com/cockroachdb/cockroach/sql 2.359s
3 changes: 3 additions & 0 deletions out.allblind.20s
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PASS
BenchmarkTrackChoices1280_Cockroach-8 500000 79451 ns/op 29265 B/op 145 allocs/op
ok github.com/cockroachdb/cockroach/sql 40.904s
2 changes: 1 addition & 1 deletion storage/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ func optimizePuts(ctx context.Context, batch engine.Engine, reqs []roachpb.Reque
iter.Seek(engine.MakeMVCCMetadataKey(minKey))
var iterKey roachpb.Key
if iter.Valid() && bytes.Compare(iter.Key().Key, maxKey) <= 0 {
iterKey = iter.Key().Key
// iterKey = iter.Key().Key
}
// Set the prefix of the run which is being written to virgin
// keyspace to "blindly" put values.
Expand Down

0 comments on commit cf89e30

Please sign in to comment.