Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Rework planNode Next and Value(s) function #374

Merged
merged 22 commits into from
Apr 28, 2022

Conversation

AndrewSisley
Copy link
Contributor

Closes #180

As discussed over discord, renames the planNode.Values function to Value and moves any logic held within the Values implementations into the Next implementations. Makes use of a new documentIterator struct to shrink the implementation effort for individual node types.

A handful of nodes do not bother using the documentIterator as their Value(s) function just calls a child planNode.

@AndrewSisley AndrewSisley added area/query Related to the query component refactor This issue specific to or requires *notable* refactoring of existing codebases and components labels Apr 25, 2022
@AndrewSisley AndrewSisley added this to the DefraDB v0.3 milestone Apr 25, 2022
@AndrewSisley AndrewSisley self-assigned this Apr 25, 2022
@codecov
Copy link

codecov bot commented Apr 25, 2022

Codecov Report

Merging #374 (144c4e1) into develop (7084daa) will decrease coverage by 0.06%.
The diff coverage is 80.14%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #374      +/-   ##
===========================================
- Coverage    65.26%   65.20%   -0.07%     
===========================================
  Files           80       80              
  Lines         9251     9251              
===========================================
- Hits          6038     6032       -6     
- Misses        2595     2599       +4     
- Partials       618      620       +2     
Impacted Files Coverage Δ
query/graphql/planner/group.go 90.00% <ø> (-0.48%) ⬇️
query/graphql/planner/versionedscan.go 0.00% <0.00%> (ø)
query/graphql/planner/planner.go 72.59% <30.00%> (+0.20%) ⬆️
query/graphql/planner/create.go 66.66% <40.00%> (-4.49%) ⬇️
query/graphql/planner/update.go 71.28% <57.14%> (-2.91%) ⬇️
query/graphql/planner/sort.go 84.28% <80.00%> (ø)
query/graphql/planner/type_join.go 68.85% <82.14%> (-0.08%) ⬇️
query/graphql/planner/commit.go 83.33% <85.71%> (-0.31%) ⬇️
query/graphql/planner/render.go 88.88% <87.50%> (+2.43%) ⬆️
query/graphql/planner/limit.go 83.33% <88.88%> (-0.54%) ⬇️
... and 14 more

@source-devs
Copy link

Benchmark Results

Summary

  • 113 Benchmarks successfully compared.
  • 108 Benchmarks were ✅ Better.
  • 5 Benchmarks were ❌ Worse .
  • 0 Benchmarks were ✨ Unchanged.
✅ See Better Results...
time/opdelta
_Collection_UserSimple_CreateMany_Sync_0_100-4297ms ± 0%249ms ± 0%−15.93%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_10-412.0ms ± 0%10.5ms ± 0%−12.03%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_100-4114ms ± 0%101ms ± 0%−11.92%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_100-447.9ms ± 0%47.3ms ± 0%−1.25%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_1000-4472ms ± 0%452ms ± 0%−4.16%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_10000-44.94s ± 0%4.58s ± 0%−7.18%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_10_10-4382µs ± 0%333µs ± 0%−12.83%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_100_100-44.18ms ± 0%3.69ms ± 0%−11.66%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_1000-441.4ms ± 0%38.0ms ± 0%−8.19%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_10-4396µs ± 0%349µs ± 0%−11.80%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_100-44.10ms ± 0%3.76ms ± 0%−8.27%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_10_10-4308µs ± 0%253µs ± 0%−17.97%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_100_100-41.93ms ± 0%1.79ms ± 0%−7.35%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_1000-424.9ms ± 0%23.8ms ± 0%−4.64%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_10-4264µs ± 0%254µs ± 0%−3.78%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_100-41.95ms ± 0%1.82ms ± 0%−6.29%(p=1.000 n=1+1)
_Query_UserSimple_Query_Sync_100-41.44ms ± 0%1.16ms ± 0%−19.63%(p=1.000 n=1+1)
_Query_UserSimple_Query_Sync_1000-410.2ms ± 0%10.2ms ± 0%−0.21%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_10-4571µs ± 0%489µs ± 0%−14.27%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_100-41.56ms ± 0%1.45ms ± 0%−7.37%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_1000-410.2ms ± 0%10.1ms ± 0%−0.72%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_10-4517µs ± 0%405µs ± 0%−21.68%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_100-4501µs ± 0%441µs ± 0%−11.98%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_1000-4440µs ± 0%419µs ± 0%−4.63%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_10-4783µs ± 0%622µs ± 0%−20.59%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_100-4700µs ± 0%648µs ± 0%−7.40%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_10-4336µs ± 0%296µs ± 0%−11.81%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_100-4346µs ± 0%284µs ± 0%−17.82%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_1000-4283µs ± 0%276µs ± 0%−2.32%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_10-4469µs ± 0%427µs ± 0%−9.05%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_100-41.58ms ± 0%1.36ms ± 0%−13.79%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_1000-412.4ms ± 0%12.2ms ± 0%−1.90%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0128-416.4µs ± 0%14.4µs ± 0%−12.12%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0256-417.6µs ± 0%14.6µs ± 0%−16.73%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0512-418.5µs ± 0%16.1µs ± 0%−13.12%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:1024-422.0µs ± 0%19.3µs ± 0%−12.28%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0064-4157µs ± 0%132µs ± 0%−15.87%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0128-4165µs ± 0%131µs ± 0%−20.42%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0256-4169µs ± 0%150µs ± 0%−10.94%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0512-4173µs ± 0%158µs ± 0%−9.00%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:1024-4224µs ± 0%188µs ± 0%−16.02%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0064-417.3µs ± 0%15.4µs ± 0%−11.02%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0128-417.4µs ± 0%15.1µs ± 0%−13.45%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0256-418.6µs ± 0%15.7µs ± 0%−15.72%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0512-421.5µs ± 0%18.0µs ± 0%−15.94%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:1024-430.2µs ± 0%20.2µs ± 0%−33.18%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0064-4165µs ± 0%139µs ± 0%−15.51%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0128-4174µs ± 0%146µs ± 0%−16.34%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0256-4181µs ± 0%152µs ± 0%−16.26%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0512-4191µs ± 0%163µs ± 0%−14.87%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:1024-4226µs ± 0%208µs ± 0%−8.17%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0064-453.9µs ± 0%48.0µs ± 0%−10.91%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0128-453.8µs ± 0%49.7µs ± 0%−7.66%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0256-459.7µs ± 0%58.5µs ± 0%−1.96%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0512-460.4µs ± 0%55.8µs ± 0%−7.65%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:1024-470.4µs ± 0%67.2µs ± 0%−4.49%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0064-4386µs ± 0%368µs ± 0%−4.68%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0128-4402µs ± 0%370µs ± 0%−7.87%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0256-4416µs ± 0%373µs ± 0%−10.38%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0512-4439µs ± 0%418µs ± 0%−4.69%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:1024-4568µs ± 0%524µs ± 0%−7.76%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0064-449.9µs ± 0%47.8µs ± 0%−4.06%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0128-450.9µs ± 0%47.2µs ± 0%−7.14%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0256-455.7µs ± 0%50.6µs ± 0%−9.14%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0512-462.5µs ± 0%55.9µs ± 0%−10.57%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:1024-475.5µs ± 0%67.2µs ± 0%−10.96%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0128-4404µs ± 0%376µs ± 0%−6.77%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0256-4461µs ± 0%376µs ± 0%−18.48%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0512-4525µs ± 0%415µs ± 0%−20.97%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:1024-4592µs ± 0%507µs ± 0%−14.39%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0064-4139µs ± 0%123µs ± 0%−11.37%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0128-4138µs ± 0%119µs ± 0%−13.63%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0256-4139µs ± 0%124µs ± 0%−11.02%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0512-4146µs ± 0%127µs ± 0%−13.49%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:1024-4160µs ± 0%141µs ± 0%−12.05%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0064-41.29ms ± 0%1.17ms ± 0%−9.31%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0128-41.39ms ± 0%1.22ms ± 0%−12.27%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0256-41.29ms ± 0%1.25ms ± 0%−3.38%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0512-41.37ms ± 0%1.25ms ± 0%−8.70%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:1024-41.56ms ± 0%1.40ms ± 0%−10.35%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0064-4135µs ± 0%114µs ± 0%−15.79%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0128-4131µs ± 0%123µs ± 0%−5.89%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0256-4130µs ± 0%128µs ± 0%−1.45%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0512-4134µs ± 0%125µs ± 0%−6.68%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0128-41.32ms ± 0%1.20ms ± 0%−8.97%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0256-41.43ms ± 0%1.25ms ± 0%−12.45%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0512-41.45ms ± 0%1.26ms ± 0%−13.29%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:1024-41.63ms ± 0%1.36ms ± 0%−16.13%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0064-414.7µs ± 0%8.5µs ± 0%−42.37%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0128-412.0µs ± 0%8.9µs ± 0%−25.75%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0256-410.7µs ± 0%10.3µs ± 0%−3.55%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0512-416.4µs ± 0%10.8µs ± 0%−34.36%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:1024-419.1µs ± 0%14.7µs ± 0%−23.19%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0064-4114µs ± 0%86µs ± 0%−24.82%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0128-4113µs ± 0%94µs ± 0%−17.00%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0256-4117µs ± 0%108µs ± 0%−7.54%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0512-4132µs ± 0%116µs ± 0%−12.05%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:1024-4182µs ± 0%152µs ± 0%−16.36%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0064-4130µs ± 0%122µs ± 0%−6.26%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0128-4132µs ± 0%122µs ± 0%−7.26%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0256-4144µs ± 0%139µs ± 0%−3.13%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0512-4141µs ± 0%126µs ± 0%−10.45%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:1024-4136µs ± 0%124µs ± 0%−8.35%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0064-41.27ms ± 0%1.25ms ± 0%−1.94%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0128-41.27ms ± 0%1.21ms ± 0%−4.66%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0256-41.40ms ± 0%1.21ms ± 0%−13.55%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0512-41.24ms ± 0%1.23ms ± 0%−1.39%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:1024-41.33ms ± 0%1.26ms ± 0%−4.78%(p=1.000 n=1+1)
 
❌ See Worse Results...
time/opdelta
_Collection_UserSimple_Create_Sync_0_1000-41.10s ± 0%1.13s ± 0%+2.98%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_1000-4642µs ± 0%676µs ± 0%+5.31%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0064-4388µs ± 0%390µs ± 0%+0.54%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:1024-4145µs ± 0%156µs ± 0%+7.36%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0064-41.24ms ± 0%1.25ms ± 0%+0.59%(p=1.000 n=1+1)
 
✨ See Unchanged Results...
time/opdelta
 
🐋 See Full Results...
develop.txtcurrent.txt
time/opdelta
pkg:github.com/sourcenetwork/defradb/bench/collection goos:linux goarch:amd64
_Collection_UserSimple_CreateMany_Sync_0_10-411.4ms ± 0%11.2ms ± 0%−2.23%(p=1.000 n=1+1)
_Collection_UserSimple_CreateMany_Sync_0_100-4297ms ± 0%249ms ± 0%−15.93%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_10-412.0ms ± 0%10.5ms ± 0%−12.03%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_100-4114ms ± 0%101ms ± 0%−11.92%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_1000-41.10s ± 0%1.13s ± 0%+2.98%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_100-447.9ms ± 0%47.3ms ± 0%−1.25%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_1000-4472ms ± 0%452ms ± 0%−4.16%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_10000-44.94s ± 0%4.58s ± 0%−7.18%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_10_10-4382µs ± 0%333µs ± 0%−12.83%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_100_100-44.18ms ± 0%3.69ms ± 0%−11.66%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_1000-441.4ms ± 0%38.0ms ± 0%−8.19%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_10-4396µs ± 0%349µs ± 0%−11.80%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_100-44.10ms ± 0%3.76ms ± 0%−8.27%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_10_10-4308µs ± 0%253µs ± 0%−17.97%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_100_100-41.93ms ± 0%1.79ms ± 0%−7.35%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_1000-424.9ms ± 0%23.8ms ± 0%−4.64%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_10-4264µs ± 0%254µs ± 0%−3.78%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_100-41.95ms ± 0%1.82ms ± 0%−6.29%(p=1.000 n=1+1)
pkg:github.com/sourcenetwork/defradb/bench/query/simple goos:linux goarch:amd64
_Query_UserSimple_Query_Sync_10-4461µs ± 0%339µs ± 0%−26.51%(p=1.000 n=1+1)
_Query_UserSimple_Query_Sync_100-41.44ms ± 0%1.16ms ± 0%−19.63%(p=1.000 n=1+1)
_Query_UserSimple_Query_Sync_1000-410.2ms ± 0%10.2ms ± 0%−0.21%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_10-4571µs ± 0%489µs ± 0%−14.27%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_100-41.56ms ± 0%1.45ms ± 0%−7.37%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_1000-410.2ms ± 0%10.1ms ± 0%−0.72%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_10-4517µs ± 0%405µs ± 0%−21.68%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_100-4501µs ± 0%441µs ± 0%−11.98%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_1000-4440µs ± 0%419µs ± 0%−4.63%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_10-4783µs ± 0%622µs ± 0%−20.59%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_100-4700µs ± 0%648µs ± 0%−7.40%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_1000-4642µs ± 0%676µs ± 0%+5.31%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_10-4336µs ± 0%296µs ± 0%−11.81%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_100-4346µs ± 0%284µs ± 0%−17.82%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_1000-4283µs ± 0%276µs ± 0%−2.32%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_10-4469µs ± 0%427µs ± 0%−9.05%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_100-41.58ms ± 0%1.36ms ± 0%−13.79%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_1000-412.4ms ± 0%12.2ms ± 0%−1.90%(p=1.000 n=1+1)
pkg:github.com/sourcenetwork/defradb/bench/storage goos:linux goarch:amd64
_Storage_Simple_Read_Sync_1_10/ValueSize:0064-414.7µs ± 0%13.3µs ± 0%−9.92%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0128-416.4µs ± 0%14.4µs ± 0%−12.12%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0256-417.6µs ± 0%14.6µs ± 0%−16.73%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0512-418.5µs ± 0%16.1µs ± 0%−13.12%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:1024-422.0µs ± 0%19.3µs ± 0%−12.28%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0064-4157µs ± 0%132µs ± 0%−15.87%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0128-4165µs ± 0%131µs ± 0%−20.42%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0256-4169µs ± 0%150µs ± 0%−10.94%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0512-4173µs ± 0%158µs ± 0%−9.00%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:1024-4224µs ± 0%188µs ± 0%−16.02%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0064-417.3µs ± 0%15.4µs ± 0%−11.02%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0128-417.4µs ± 0%15.1µs ± 0%−13.45%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0256-418.6µs ± 0%15.7µs ± 0%−15.72%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0512-421.5µs ± 0%18.0µs ± 0%−15.94%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:1024-430.2µs ± 0%20.2µs ± 0%−33.18%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0064-4165µs ± 0%139µs ± 0%−15.51%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0128-4174µs ± 0%146µs ± 0%−16.34%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0256-4181µs ± 0%152µs ± 0%−16.26%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0512-4191µs ± 0%163µs ± 0%−14.87%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:1024-4226µs ± 0%208µs ± 0%−8.17%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0064-453.9µs ± 0%48.0µs ± 0%−10.91%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0128-453.8µs ± 0%49.7µs ± 0%−7.66%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0256-459.7µs ± 0%58.5µs ± 0%−1.96%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0512-460.4µs ± 0%55.8µs ± 0%−7.65%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:1024-470.4µs ± 0%67.2µs ± 0%−4.49%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0064-4386µs ± 0%368µs ± 0%−4.68%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0128-4402µs ± 0%370µs ± 0%−7.87%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0256-4416µs ± 0%373µs ± 0%−10.38%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0512-4439µs ± 0%418µs ± 0%−4.69%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:1024-4568µs ± 0%524µs ± 0%−7.76%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0064-449.9µs ± 0%47.8µs ± 0%−4.06%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0128-450.9µs ± 0%47.2µs ± 0%−7.14%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0256-455.7µs ± 0%50.6µs ± 0%−9.14%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0512-462.5µs ± 0%55.9µs ± 0%−10.57%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:1024-475.5µs ± 0%67.2µs ± 0%−10.96%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0064-4388µs ± 0%390µs ± 0%+0.54%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0128-4404µs ± 0%376µs ± 0%−6.77%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0256-4461µs ± 0%376µs ± 0%−18.48%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0512-4525µs ± 0%415µs ± 0%−20.97%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:1024-4592µs ± 0%507µs ± 0%−14.39%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0064-4139µs ± 0%123µs ± 0%−11.37%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0128-4138µs ± 0%119µs ± 0%−13.63%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0256-4139µs ± 0%124µs ± 0%−11.02%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0512-4146µs ± 0%127µs ± 0%−13.49%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:1024-4160µs ± 0%141µs ± 0%−12.05%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0064-41.29ms ± 0%1.17ms ± 0%−9.31%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0128-41.39ms ± 0%1.22ms ± 0%−12.27%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0256-41.29ms ± 0%1.25ms ± 0%−3.38%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0512-41.37ms ± 0%1.25ms ± 0%−8.70%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:1024-41.56ms ± 0%1.40ms ± 0%−10.35%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0064-4135µs ± 0%114µs ± 0%−15.79%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0128-4131µs ± 0%123µs ± 0%−5.89%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0256-4130µs ± 0%128µs ± 0%−1.45%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0512-4134µs ± 0%125µs ± 0%−6.68%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:1024-4145µs ± 0%156µs ± 0%+7.36%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0064-41.24ms ± 0%1.25ms ± 0%+0.59%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0128-41.32ms ± 0%1.20ms ± 0%−8.97%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0256-41.43ms ± 0%1.25ms ± 0%−12.45%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0512-41.45ms ± 0%1.26ms ± 0%−13.29%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:1024-41.63ms ± 0%1.36ms ± 0%−16.13%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0064-414.7µs ± 0%8.5µs ± 0%−42.37%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0128-412.0µs ± 0%8.9µs ± 0%−25.75%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0256-410.7µs ± 0%10.3µs ± 0%−3.55%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0512-416.4µs ± 0%10.8µs ± 0%−34.36%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:1024-419.1µs ± 0%14.7µs ± 0%−23.19%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0064-4114µs ± 0%86µs ± 0%−24.82%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0128-4113µs ± 0%94µs ± 0%−17.00%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0256-4117µs ± 0%108µs ± 0%−7.54%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0512-4132µs ± 0%116µs ± 0%−12.05%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:1024-4182µs ± 0%152µs ± 0%−16.36%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0064-4130µs ± 0%122µs ± 0%−6.26%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0128-4132µs ± 0%122µs ± 0%−7.26%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0256-4144µs ± 0%139µs ± 0%−3.13%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0512-4141µs ± 0%126µs ± 0%−10.45%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:1024-4136µs ± 0%124µs ± 0%−8.35%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0064-41.27ms ± 0%1.25ms ± 0%−1.94%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0128-41.27ms ± 0%1.21ms ± 0%−4.66%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0256-41.40ms ± 0%1.21ms ± 0%−13.55%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0512-41.24ms ± 0%1.23ms ± 0%−1.39%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:1024-41.33ms ± 0%1.26ms ± 0%−4.78%(p=1.000 n=1+1)
 

Moves Next to next to Values, and Spans next to Init and Start - feels a more natural grouping based on when/where they will be called.
I'm guessing this is out of date, as it doesnt make sense to me
Singular removes suggestion that it might return an entire iteration, and more strongly suggests that it is just a getter with the bulk of the work taking place in Next.
Also handles the previously ignored error
Also handles the previously ignored errors
@AndrewSisley AndrewSisley force-pushed the sisley/refactor/I180-node-values-value branch from 9dfbb95 to 144c4e1 Compare April 26, 2022 16:34
@source-devs
Copy link

Benchmark Results

Summary

  • 113 Benchmarks successfully compared.
  • 30 Benchmarks were ✅ Better.
  • 83 Benchmarks were ❌ Worse .
  • 0 Benchmarks were ✨ Unchanged.
✅ See Better Results...
time/opdelta
_Collection_UserSimple_Create_Sync_0_100-4105ms ± 0%101ms ± 0%−4.14%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_1000-4469ms ± 0%453ms ± 0%−3.52%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_10000-44.66s ± 0%4.57s ± 0%−1.96%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_10_10-4347µs ± 0%344µs ± 0%−1.11%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_1000-439.9ms ± 0%39.6ms ± 0%−0.79%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_10-4375µs ± 0%343µs ± 0%−8.61%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_100-43.83ms ± 0%3.77ms ± 0%−1.61%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_1000-424.1ms ± 0%23.6ms ± 0%−2.14%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_10-4262µs ± 0%255µs ± 0%−2.60%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_100-41.89ms ± 0%1.84ms ± 0%−2.14%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_10-4297µs ± 0%287µs ± 0%−3.25%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_100-4291µs ± 0%272µs ± 0%−6.78%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_1000-4276µs ± 0%274µs ± 0%−0.46%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_100-41.37ms ± 0%1.35ms ± 0%−2.04%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0256-4392µs ± 0%385µs ± 0%−1.61%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:1024-4506µs ± 0%502µs ± 0%−0.90%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0064-4126µs ± 0%119µs ± 0%−6.21%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0128-4127µs ± 0%120µs ± 0%−5.14%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0256-4125µs ± 0%124µs ± 0%−0.94%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0512-4131µs ± 0%131µs ± 0%−0.09%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0064-41.31ms ± 0%1.17ms ± 0%−10.34%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0128-41.26ms ± 0%1.21ms ± 0%−3.85%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0512-41.30ms ± 0%1.27ms ± 0%−2.94%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0064-4116µs ± 0%115µs ± 0%−1.28%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0128-41.19ms ± 0%1.18ms ± 0%−0.52%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0512-41.24ms ± 0%1.24ms ± 0%−0.10%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0128-410.3µs ± 0%9.9µs ± 0%−4.30%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0256-410.6µs ± 0%10.5µs ± 0%−1.04%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0064-493.4µs ± 0%92.4µs ± 0%−1.11%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0128-4101µs ± 0%101µs ± 0%−0.01%(p=1.000 n=1+1)
 
❌ See Worse Results...
time/opdelta
_Collection_UserSimple_CreateMany_Sync_0_100-4220ms ± 0%259ms ± 0%+17.51%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_10-410.3ms ± 0%10.8ms ± 0%+4.61%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_1000-41.00s ± 0%1.01s ± 0%+1.03%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_100-445.8ms ± 0%45.9ms ± 0%+0.22%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_100_100-43.66ms ± 0%3.72ms ± 0%+1.60%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_10_10-4260µs ± 0%307µs ± 0%+17.79%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_100_100-41.86ms ± 0%1.86ms ± 0%+0.30%(p=1.000 n=1+1)
_Query_UserSimple_Query_Sync_100-41.16ms ± 0%1.24ms ± 0%+6.90%(p=1.000 n=1+1)
_Query_UserSimple_Query_Sync_1000-49.72ms ± 0%9.98ms ± 0%+2.61%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_10-4427µs ± 0%454µs ± 0%+6.45%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_100-41.23ms ± 0%1.47ms ± 0%+19.81%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_1000-410.0ms ± 0%10.1ms ± 0%+0.33%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_10-4377µs ± 0%395µs ± 0%+4.94%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_100-4434µs ± 0%501µs ± 0%+15.37%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_1000-4431µs ± 0%454µs ± 0%+5.29%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_10-4643µs ± 0%658µs ± 0%+2.38%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_100-4644µs ± 0%682µs ± 0%+5.90%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_1000-4639µs ± 0%656µs ± 0%+2.66%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_10-4407µs ± 0%416µs ± 0%+2.05%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_1000-412.2ms ± 0%12.3ms ± 0%+0.67%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0128-413.5µs ± 0%15.1µs ± 0%+11.85%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0256-414.3µs ± 0%15.1µs ± 0%+5.31%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0512-415.8µs ± 0%18.9µs ± 0%+19.52%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:1024-420.1µs ± 0%20.3µs ± 0%+1.03%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0064-4129µs ± 0%140µs ± 0%+8.25%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0128-4132µs ± 0%150µs ± 0%+13.26%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0256-4145µs ± 0%152µs ± 0%+5.12%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0512-4156µs ± 0%164µs ± 0%+4.76%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:1024-4192µs ± 0%205µs ± 0%+6.76%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0064-414.9µs ± 0%16.2µs ± 0%+8.15%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0128-415.3µs ± 0%15.9µs ± 0%+4.11%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0256-415.3µs ± 0%16.4µs ± 0%+7.19%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0512-417.4µs ± 0%21.9µs ± 0%+25.45%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:1024-421.1µs ± 0%22.2µs ± 0%+5.07%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0064-4133µs ± 0%149µs ± 0%+12.13%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0128-4141µs ± 0%159µs ± 0%+12.85%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0256-4145µs ± 0%157µs ± 0%+7.92%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0512-4158µs ± 0%188µs ± 0%+18.63%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:1024-4201µs ± 0%205µs ± 0%+2.23%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0064-447.5µs ± 0%53.2µs ± 0%+12.00%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0128-447.2µs ± 0%49.1µs ± 0%+4.00%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0256-453.0µs ± 0%57.6µs ± 0%+8.55%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0512-455.2µs ± 0%57.3µs ± 0%+3.82%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:1024-467.8µs ± 0%70.5µs ± 0%+3.98%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0064-4335µs ± 0%404µs ± 0%+20.41%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0128-4345µs ± 0%385µs ± 0%+11.68%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0256-4357µs ± 0%385µs ± 0%+7.73%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0512-4400µs ± 0%440µs ± 0%+10.06%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:1024-4488µs ± 0%497µs ± 0%+1.77%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0064-443.8µs ± 0%45.7µs ± 0%+4.26%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0128-445.8µs ± 0%49.3µs ± 0%+7.59%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0256-449.6µs ± 0%51.9µs ± 0%+4.72%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0512-453.3µs ± 0%62.2µs ± 0%+16.79%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:1024-471.4µs ± 0%72.0µs ± 0%+0.88%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0064-4365µs ± 0%416µs ± 0%+14.12%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0128-4365µs ± 0%410µs ± 0%+12.44%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0512-4420µs ± 0%422µs ± 0%+0.51%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:1024-4141µs ± 0%148µs ± 0%+5.48%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0256-41.30ms ± 0%1.32ms ± 0%+2.08%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:1024-41.45ms ± 0%1.47ms ± 0%+1.12%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0128-4120µs ± 0%120µs ± 0%+0.55%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0256-4118µs ± 0%126µs ± 0%+6.56%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0512-4125µs ± 0%135µs ± 0%+7.95%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:1024-4136µs ± 0%146µs ± 0%+6.71%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0064-41.20ms ± 0%1.22ms ± 0%+1.56%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0256-41.21ms ± 0%1.27ms ± 0%+4.64%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:1024-41.36ms ± 0%1.45ms ± 0%+6.73%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0064-48.42µs ± 0%8.69µs ± 0%+3.28%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0512-413.0µs ± 0%13.0µs ± 0%+0.09%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:1024-416.0µs ± 0%16.9µs ± 0%+5.98%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0256-4100µs ± 0%110µs ± 0%+9.62%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0512-4123µs ± 0%126µs ± 0%+2.07%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:1024-4154µs ± 0%192µs ± 0%+25.17%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0064-4126µs ± 0%132µs ± 0%+4.56%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0128-4125µs ± 0%131µs ± 0%+4.74%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0256-4122µs ± 0%136µs ± 0%+11.61%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0512-4123µs ± 0%132µs ± 0%+7.39%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:1024-4133µs ± 0%136µs ± 0%+2.19%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0064-41.27ms ± 0%1.30ms ± 0%+2.72%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0128-41.17ms ± 0%1.22ms ± 0%+3.75%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0256-41.23ms ± 0%1.27ms ± 0%+2.85%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0512-41.21ms ± 0%1.24ms ± 0%+2.58%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:1024-41.28ms ± 0%1.32ms ± 0%+3.09%(p=1.000 n=1+1)
 
✨ See Unchanged Results...
time/opdelta
 
🐋 See Full Results...
develop.txtcurrent.txt
time/opdelta
pkg:github.com/sourcenetwork/defradb/bench/collection goos:linux goarch:amd64
_Collection_UserSimple_CreateMany_Sync_0_10-411.0ms ± 0%11.0ms ± 0%−0.64%(p=1.000 n=1+1)
_Collection_UserSimple_CreateMany_Sync_0_100-4220ms ± 0%259ms ± 0%+17.51%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_10-410.3ms ± 0%10.8ms ± 0%+4.61%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_100-4105ms ± 0%101ms ± 0%−4.14%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Sync_0_1000-41.00s ± 0%1.01s ± 0%+1.03%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_100-445.8ms ± 0%45.9ms ± 0%+0.22%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_1000-4469ms ± 0%453ms ± 0%−3.52%(p=1.000 n=1+1)
_Collection_UserSimple_Create_Async_0_10000-44.66s ± 0%4.57s ± 0%−1.96%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_10_10-4347µs ± 0%344µs ± 0%−1.11%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_100_100-43.66ms ± 0%3.72ms ± 0%+1.60%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_1000-439.9ms ± 0%39.6ms ± 0%−0.79%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_10-4375µs ± 0%343µs ± 0%−8.61%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Sync_1000_100-43.83ms ± 0%3.77ms ± 0%−1.61%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_10_10-4260µs ± 0%307µs ± 0%+17.79%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_100_100-41.86ms ± 0%1.86ms ± 0%+0.30%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_1000-424.1ms ± 0%23.6ms ± 0%−2.14%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_10-4262µs ± 0%255µs ± 0%−2.60%(p=1.000 n=1+1)
_Collection_UserSimple_Read_Async_1000_100-41.89ms ± 0%1.84ms ± 0%−2.14%(p=1.000 n=1+1)
pkg:github.com/sourcenetwork/defradb/bench/query/simple goos:linux goarch:amd64
_Query_UserSimple_Query_Sync_10-4351µs ± 0%361µs ± 0%+3.00%(p=1.000 n=1+1)
_Query_UserSimple_Query_Sync_100-41.16ms ± 0%1.24ms ± 0%+6.90%(p=1.000 n=1+1)
_Query_UserSimple_Query_Sync_1000-49.72ms ± 0%9.98ms ± 0%+2.61%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_10-4427µs ± 0%454µs ± 0%+6.45%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_100-41.23ms ± 0%1.47ms ± 0%+19.81%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithFilter_Sync_1000-410.0ms ± 0%10.1ms ± 0%+0.33%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_10-4377µs ± 0%395µs ± 0%+4.94%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_100-4434µs ± 0%501µs ± 0%+15.37%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithLimitOffset_Sync_1000-4431µs ± 0%454µs ± 0%+5.29%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_10-4643µs ± 0%658µs ± 0%+2.38%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_100-4644µs ± 0%682µs ± 0%+5.90%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithMultiLookup_Sync_1000-4639µs ± 0%656µs ± 0%+2.66%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_10-4297µs ± 0%287µs ± 0%−3.25%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_100-4291µs ± 0%272µs ± 0%−6.78%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSingleLookup_Sync_1000-4276µs ± 0%274µs ± 0%−0.46%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_10-4407µs ± 0%416µs ± 0%+2.05%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_100-41.37ms ± 0%1.35ms ± 0%−2.04%(p=1.000 n=1+1)
_Query_UserSimple_Query_WithSort_Sync_1000-412.2ms ± 0%12.3ms ± 0%+0.67%(p=1.000 n=1+1)
pkg:github.com/sourcenetwork/defradb/bench/storage goos:linux goarch:amd64
_Storage_Simple_Read_Sync_1_10/ValueSize:0064-412.6µs ± 0%15.8µs ± 0%+25.32%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0128-413.5µs ± 0%15.1µs ± 0%+11.85%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0256-414.3µs ± 0%15.1µs ± 0%+5.31%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:0512-415.8µs ± 0%18.9µs ± 0%+19.52%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_10/ValueSize:1024-420.1µs ± 0%20.3µs ± 0%+1.03%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0064-4129µs ± 0%140µs ± 0%+8.25%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0128-4132µs ± 0%150µs ± 0%+13.26%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0256-4145µs ± 0%152µs ± 0%+5.12%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:0512-4156µs ± 0%164µs ± 0%+4.76%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_1_100/ValueSize:1024-4192µs ± 0%205µs ± 0%+6.76%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0064-414.9µs ± 0%16.2µs ± 0%+8.15%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0128-415.3µs ± 0%15.9µs ± 0%+4.11%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0256-415.3µs ± 0%16.4µs ± 0%+7.19%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:0512-417.4µs ± 0%21.9µs ± 0%+25.45%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_10/ValueSize:1024-421.1µs ± 0%22.2µs ± 0%+5.07%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0064-4133µs ± 0%149µs ± 0%+12.13%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0128-4141µs ± 0%159µs ± 0%+12.85%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0256-4145µs ± 0%157µs ± 0%+7.92%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:0512-4158µs ± 0%188µs ± 0%+18.63%(p=1.000 n=1+1)
_Storage_Simple_Read_Sync_100_100/ValueSize:1024-4201µs ± 0%205µs ± 0%+2.23%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0064-447.5µs ± 0%53.2µs ± 0%+12.00%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0128-447.2µs ± 0%49.1µs ± 0%+4.00%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0256-453.0µs ± 0%57.6µs ± 0%+8.55%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:0512-455.2µs ± 0%57.3µs ± 0%+3.82%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_10/ValueSize:1024-467.8µs ± 0%70.5µs ± 0%+3.98%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0064-4335µs ± 0%404µs ± 0%+20.41%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0128-4345µs ± 0%385µs ± 0%+11.68%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0256-4357µs ± 0%385µs ± 0%+7.73%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:0512-4400µs ± 0%440µs ± 0%+10.06%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_0_100/ValueSize:1024-4488µs ± 0%497µs ± 0%+1.77%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0064-443.8µs ± 0%45.7µs ± 0%+4.26%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0128-445.8µs ± 0%49.3µs ± 0%+7.59%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0256-449.6µs ± 0%51.9µs ± 0%+4.72%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:0512-453.3µs ± 0%62.2µs ± 0%+16.79%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_10/ValueSize:1024-471.4µs ± 0%72.0µs ± 0%+0.88%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0064-4365µs ± 0%416µs ± 0%+14.12%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0128-4365µs ± 0%410µs ± 0%+12.44%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0256-4392µs ± 0%385µs ± 0%−1.61%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:0512-4420µs ± 0%422µs ± 0%+0.51%(p=1.000 n=1+1)
_Storage_Simple_WriteMany_Sync_100_100/ValueSize:1024-4506µs ± 0%502µs ± 0%−0.90%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0064-4126µs ± 0%119µs ± 0%−6.21%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0128-4127µs ± 0%120µs ± 0%−5.14%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0256-4125µs ± 0%124µs ± 0%−0.94%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:0512-4131µs ± 0%131µs ± 0%−0.09%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_10/ValueSize:1024-4141µs ± 0%148µs ± 0%+5.48%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0064-41.31ms ± 0%1.17ms ± 0%−10.34%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0128-41.26ms ± 0%1.21ms ± 0%−3.85%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0256-41.30ms ± 0%1.32ms ± 0%+2.08%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:0512-41.30ms ± 0%1.27ms ± 0%−2.94%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_0_100/ValueSize:1024-41.45ms ± 0%1.47ms ± 0%+1.12%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0064-4116µs ± 0%115µs ± 0%−1.28%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0128-4120µs ± 0%120µs ± 0%+0.55%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0256-4118µs ± 0%126µs ± 0%+6.56%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:0512-4125µs ± 0%135µs ± 0%+7.95%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_10/ValueSize:1024-4136µs ± 0%146µs ± 0%+6.71%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0064-41.20ms ± 0%1.22ms ± 0%+1.56%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0128-41.19ms ± 0%1.18ms ± 0%−0.52%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0256-41.21ms ± 0%1.27ms ± 0%+4.64%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:0512-41.24ms ± 0%1.24ms ± 0%−0.10%(p=1.000 n=1+1)
_Storage_Simple_Write_Sync_100_100/ValueSize:1024-41.36ms ± 0%1.45ms ± 0%+6.73%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0064-48.42µs ± 0%8.69µs ± 0%+3.28%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0128-410.3µs ± 0%9.9µs ± 0%−4.30%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0256-410.6µs ± 0%10.5µs ± 0%−1.04%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:0512-413.0µs ± 0%13.0µs ± 0%+0.09%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_10_10/ValueSize:1024-416.0µs ± 0%16.9µs ± 0%+5.98%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0064-493.4µs ± 0%92.4µs ± 0%−1.11%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0128-4101µs ± 0%101µs ± 0%−0.01%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0256-4100µs ± 0%110µs ± 0%+9.62%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:0512-4123µs ± 0%126µs ± 0%+2.07%(p=1.000 n=1+1)
_Storage_Simple_Txn_Read_Sync_100_100/ValueSize:1024-4154µs ± 0%192µs ± 0%+25.17%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0064-4126µs ± 0%132µs ± 0%+4.56%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0128-4125µs ± 0%131µs ± 0%+4.74%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0256-4122µs ± 0%136µs ± 0%+11.61%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:0512-4123µs ± 0%132µs ± 0%+7.39%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_10_1_10/ValueSize:1024-4133µs ± 0%136µs ± 0%+2.19%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0064-41.27ms ± 0%1.30ms ± 0%+2.72%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0128-41.17ms ± 0%1.22ms ± 0%+3.75%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0256-41.23ms ± 0%1.27ms ± 0%+2.85%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:0512-41.21ms ± 0%1.24ms ± 0%+2.58%(p=1.000 n=1+1)
_Storage_Simple_Txn_Iterator_Sync_100_1_100/ValueSize:1024-41.28ms ± 0%1.32ms ± 0%+3.09%(p=1.000 n=1+1)
 

Copy link
Member

@jsimnz jsimnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few notes, no notable issues since its mostly just renaming the interface funcs and their references. As far as I can tell, any of the nodes which had functionality in the Values() method has been accurately ported to the Next() call instead.

Made a comment about the documentIterator just from a naming perspective.

Comment on lines -402 to +398
m := &parallelNode{p: s.p, doc: make(map[string]interface{})}
m := &parallelNode{p: s.p}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we don't need to instanciate the map here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is it always assigned to before access (first line of Next)

@@ -423,7 +419,6 @@ func (s *selectNode) addSubPlan(field string, plan planNode) error {
multinode := &parallelNode{
p: s.p,
multiscan: multiscan,
doc: make(map[string]interface{}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before, do we not need to instantiate the map?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other comment: No it is it always assigned to before access (first line of Next)

@@ -131,8 +128,8 @@ func (n *selectNode) Next() (bool, error) {
return false, err
}

n.doc = n.source.Values()
passes, err := parser.RunFilter(n.doc, n.filter, n.p.evalCtx)
n.currentValue = n.source.Value()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the n.source.Value() go into a temp variable until we know the filter passes? Instead of directly being assigned to the currentValue var?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesnt really matter - if Next returns false this value is invalid/irrelevant anyway - and unless adding some logic to explicitly set it to nil if returning false (which I see as a valid, but wasteful option, as it would never be used)

return false, nil
}

passed, err := parser.RunFilter(n.doc, n.filter, n.p.evalCtx)
passed, err := parser.RunFilter(n.currentValue, n.filter, n.p.evalCtx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before about assigning a value to currentValue before running the Filter. I don't think technically it could be an issue since the planner is executed serially in a single goroutine, just a thought

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment to my response to this, also worth noting is style (Next/Value) that (normal) iterators are inherently thread-unsafe as there will always be a race condition unless a lock is exposed that can wrap Next+Value calls

func (n *baseNode) Close() error { return n.plan.Close() } //nolint:unused
func (n *baseNode) Source() planNode { return n.plan } //nolint:unused

type documentIterator struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming here might not be quite right. If you have anything off the top of your head that might be more approprite to its use (embedded doc map and Value() method) as itself isn't doing anything w.r.t the "Iterator" pattern, but is just an internal utility to avoid code duplication.

If nothing immediately comes to mind, you can merge as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree with you, the name is a bit off as it itself isn't a complete iterator. Nothing comes to mind atm, but will very happily change retrospectively if I (or anyone else) comes up with a better idea

@AndrewSisley AndrewSisley merged commit 655433d into develop Apr 28, 2022
@AndrewSisley AndrewSisley deleted the sisley/refactor/I180-node-values-value branch April 28, 2022 01:16
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
* Reorder plannode interface funcs

Moves Next to next to Values, and Spans next to Init and Start - feels a more natural grouping based on when/where they will be called.

* Remove ambiguous comment-line

I'm guessing this is out of date, as it doesnt make sense to me

* Rename planNode.Values to Value

Singular removes suggestion that it might return an entire iteration, and more strongly suggests that it is just a getter with the bulk of the work taking place in Next.

* Introduce documentIterator

* Move logic from count.Values into count.Next

* Move logic from create.Values into create.Next

Also handles the previously ignored error

* Move logic from dagscan.Values into dagscan.Next

* Move logic from commitSelect.Values into commitSelect.Next

* Remove misleading comment from delete.Next

* Refactor group node to use document iterator

* Move logic from limit.Values into limit.Next

* Refactor parallel node to use document iterator

* Move logic from pipe.Values into pipe.Next

* Move logic from render.Values into render.Next

* Refactor scan node to use document iterator

* Refactor select node to use document iterator

* Move logic from sum.Values into sum.Next

* Move logic from typeJoinOne.Values into typeJoinOne.Next

* Move logic from typeJoinMany.Values into typeJoinMany.Next

Also handles the previously ignored errors

* Remove commented out code

* Move logic from update.Values into update.Next

Also handles the previously ignored errors

* Refactor versionScan node to use document iterator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component refactor This issue specific to or requires *notable* refactoring of existing codebases and components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properly handle errors in planNode.Values method(s)
3 participants