Skip to main content

crdt_lf

The engine: every handler (local writes, remote changes, reads), applying changes, the DAG, snapshots, serialization, nested handlers, undo, and how the costs grow with the size of the document. One section per benchmark file in benchmarks/src/benchmarks/.

apply_changes_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Apply 1000 changes942.92900.94290.000943

apply_changes_capabilities_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Apply 1000 changes (capabilities tracked)956.01350.95600.000956

change_roundtrip_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Change toBytes x100061.39070.06140.000061
Change fromBytes x100018.62020.01860.000019
Change roundtrip x100081.37000.08140.000081

dag_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
DAG addNode chain of 1000182.62880.18260.000183
DAG getAncestors chain of 2007.45500.00750.000007

delete_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Remote delete with 100 open containers6.97500.00700.000007
Remote delete with 1000 open containers5.73000.00570.000006
Remote delete with 10000 open containers5.13500.00510.000005
Remote delete after 100 deletes7.69000.00770.000008
Remote delete after 1000 deletes36.33500.03630.000036
Remote delete after 10000 deletes327.53000.32750.000328

delta_emission_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Fugue text remote keystroke + read on 2000 chars (watched: false)42.78500.04280.000043
Fugue text remote keystroke + read on 2000 chars (watched: true)33.97500.03400.000034
Fugue text remote keystroke + read on 10000 chars (watched: false)88.20000.08820.000088
Fugue text remote keystroke + read on 10000 chars (watched: true)84.10000.08410.000084
Text remote keystroke + read on 2000 chars (watched: false)8.96500.00900.000009
Text remote keystroke + read on 2000 chars (watched: true)12.62500.01260.000013
Text remote keystroke + read on 10000 chars (watched: false)11.46500.01150.000011
Text remote keystroke + read on 10000 chars (watched: true)15.71000.01570.000016
Map remote write + read on 1000 keys (watched: false)7.84000.00780.000008
Map remote write + read on 1000 keys (watched: true)13.43500.01340.000013
Map remote write + read on 5000 keys (watched: false)4.48500.00450.000004
Map remote write + read on 5000 keys (watched: true)5.35000.00530.000005
Movable list remote move + read on 1000 elements (watched: false)47.39500.04740.000047
Movable list remote move + read on 1000 elements (watched: true)68.64000.06860.000069
Movable list remote move + read on 5000 elements (watched: false)181.18000.18120.000181
Movable list remote move + read on 5000 elements (watched: true)338.33000.33830.000338
Fugue text type 2000 chars locally (watched: false)55555.945955.55590.055556
Fugue text type 2000 chars locally (watched: true)84277.724184.27770.084278

fugue_list_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
CRDTFugueListHandler do 1000 operations and get value (incremental cache update: true)3051.66823.05170.003052

fugue_snapshot_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Fugue text takeSnapshot of 10000 elements (tombstones: false)998.73150.99870.000999
Fugue text restore of 10000 elements from snapshot (tombstones: false)1238.09061.23810.001238
Fugue text takeSnapshot of 10000 elements (tombstones: true)1079.16021.07920.001079
Fugue text restore of 10000 elements from snapshot (tombstones: true)1273.91331.27390.001274
Fugue text takeSnapshot of 100000 elements (tombstones: false)42357.400042.35740.042357
Fugue text restore of 100000 elements from snapshot (tombstones: false)32776.000032.77600.032776
Fugue text takeSnapshot of 100000 elements (tombstones: true)43902.966743.90300.043903
Fugue text restore of 100000 elements from snapshot (tombstones: true)32188.757132.18880.032189

fugue_text_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Fugue text keystroke + length on 30000 chars11.92500.01190.000012
Fugue text keystroke + value on 30000 chars360.08000.36010.000360
Fugue text update on 30000 chars1.72500.00170.000002

fugue_tree_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
FugueTree append 50000 elements10832.126310.83210.010832
FugueTree prepend 50000 elements92014.150092.01420.092014
FugueTree random insert 50000 elements116325.3000116.32530.116325
FugueTree values() over 50000 live elements385.88940.38590.000386
FugueTree values() over 50000 elements, 90% tombstones61.57640.06160.000062

list_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
CRDTListHandler do 1000 operations and get value (incremental cache update: true)2396.95062.39700.002397

map_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
CRDTMapHandler do 1000 operations and get value (incremental cache update: true)2728.35452.72840.002728

nested_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Resolve nested tree with 50 leaves (cold caches)110.51890.11050.000111
Resolve nested tree with 200 leaves (cold caches)477.02090.47700.000477
Resolve nested tree with 800 leaves (cold caches)1995.57281.99560.001996
Import + resolve nested tree with 50 leaves (fresh peer)171.11650.17110.000171
Import + resolve nested tree with 200 leaves (fresh peer)646.83900.64680.000647
Import + resolve nested tree with 800 leaves (fresh peer)3383.56383.38360.003384

op_id_key_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
OpIdKey view x100k464.33570.46430.000464
OpIdKey hashCode x100k (cold)1818.57141.81860.001819
OpIdKey map lookup x10k68.87510.06890.000069
OperationId map lookup x10k57.52730.05750.000058

or_set_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
CRDTORSetHandler do 1000 operations and get value (incremental cache update: true)2836.90532.83690.002837

peer_id_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
PeerId generate x100192.19030.19220.000192
PeerId toUint8List x100032.01190.03200.000032
PeerId fromUint8List x100053.16570.05320.000053

remote_apply_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Fugue text remote keystroke + read on 2000 chars42.93500.04290.000043
Fugue text remote keystroke + read on 10000 chars93.42500.09340.000093
Fugue text remote keystroke + read on 30000 chars316.96500.31700.000317
Text remote keystroke + read on 2000 chars9.68500.00970.000010
Text remote keystroke + read on 10000 chars12.29500.01230.000012
Text remote keystroke + read on 30000 chars20.07500.02010.000020
Map remote set + read on 1000 keys12.08500.01210.000012
Map remote set + read on 5000 keys11.22500.01120.000011
OR-set remote add from the past + read on 1000 values40.01000.04000.000040
OR-set remote add from the past + read on 5000 values103.12000.10310.000103
OR-map remote put from the past + read on 1000 keys63.28000.06330.000063
OR-map remote put from the past + read on 5000 keys234.30500.23430.000234
Movable list remote move from the past + read on 1000 items46.17500.04620.000046
Movable list remote move from the past + read on 5000 items174.13500.17410.000174

rich_text_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Fugue text (baseline) keystroke + length on 30000 chars13.56500.01360.000014
Fugue text (baseline) keystroke + value on 30000 chars348.40500.34840.000348
Fugue text (baseline) delete + length on 30000 chars1.50000.00150.000002
Fugue text (baseline) delete + value on 30000 chars298.01000.29800.000298
Rich text keystroke + length on 30000 chars9.93500.00990.000010
Rich text keystroke + value on 30000 chars364.12500.36410.000364
Rich text delete + length on 30000 chars1.69000.00170.000002
Rich text delete + value on 30000 chars325.46500.32550.000325
Rich text (marked lines) keystroke + length on 30000 chars28.33000.02830.000028
Rich text (marked lines) keystroke + value on 30000 chars537.21000.53720.000537
Rich text (marked lines) delete + length on 30000 chars13.95500.01400.000014
Rich text (marked lines) delete + value on 30000 chars392.79500.39280.000393
Fugue text (baseline) insert 100 lines (watched: false)931.10000.93110.000931
Rich text insert 100 lines (watched: false)679.80000.67980.000680
Rich text insert 100 lines x 3 attributes (watched: false)2171.10002.17110.002171
Fugue text (baseline) insert 100 lines (watched: true)678.30000.67830.000678
Rich text insert 100 lines (watched: true)678.70000.67870.000679
Rich text insert 100 lines x 3 attributes (watched: true)3126.40003.12640.003126
Fugue text (baseline) insert 1000 lines (watched: false)9673.50009.67350.009673
Rich text insert 1000 lines (watched: false)10282.800010.28280.010283
Rich text insert 1000 lines x 3 attributes (watched: false)25169.200025.16920.025169
Fugue text (baseline) insert 1000 lines (watched: true)10084.200010.08420.010084
Rich text insert 1000 lines (watched: true)10285.000010.28500.010285
Rich text insert 1000 lines x 3 attributes (watched: true)71979.900071.97990.071980
Rich text format bold on/off + length on 30000 chars (watched: false)5.58000.00560.000006
Rich text format bold on/off + length on 30000 chars (watched: true)6.98000.00700.000007
Rich text (marked lines) format bold on/off + length on 30000 chars (watched: false)443.71000.44370.000444
Rich text (marked lines) format bold on/off + length on 30000 chars (watched: true)649.02000.64900.000649
Fugue text (baseline) import 1000 line inserts + value11959.900011.95990.011960
Rich text import 1000 line inserts + value11855.400011.85540.011855
Rich text (marked lines) import 1000 line inserts + value28666.800028.66680.028667
Fugue text (baseline) remote keystroke + value on 30000 chars326.19500.32620.000326
Rich text remote keystroke + value on 30000 chars376.06000.37610.000376
Rich text (marked lines) remote keystroke + value on 30000 chars498.80000.49880.000499
Rich text remote format bold on/off + value on 30000 chars311.01000.31100.000311
Rich text (marked lines) remote format bold on/off + value on 30000 chars638.95000.63900.000639
Fugue text (baseline) takeSnapshot of 10000 elements1081.70941.08170.001082
Fugue text (baseline) restore of 10000 elements from snapshot1105.25421.10530.001105
Rich text (marked lines) takeSnapshot of 10000 elements3984.09653.98410.003984
Rich text (marked lines) restore of 10000 elements from snapshot6835.28806.83530.006835
Fugue text (baseline) takeSnapshot of 100000 elements42781.000042.78100.042781
Fugue text (baseline) restore of 100000 elements from snapshot28795.100028.79510.028795
Rich text (marked lines) takeSnapshot of 100000 elements114507.4500114.50740.114507
Rich text (marked lines) restore of 100000 elements from snapshot124206.4000124.20640.124206
Rich text undo+redo a bold format on 30000 chars38.75000.03870.000039
Rich text (marked lines) undo+redo a bold format on 30000 chars526.75000.52680.000527
Fugue text (baseline) undo+redo a 1-char delete on 30000 chars4.40000.00440.000004
Rich text undo+redo a 1-char delete on 30000 chars6.80000.00680.000007
Rich text (marked lines) undo+redo a 1-char delete on 30000 chars21.50000.02150.000022
Fugue text (baseline) undo+redo a 100-char delete on 30000 chars65.15000.06510.000065
Rich text undo+redo a 100-char delete on 30000 chars66.00000.06600.000066
Rich text (marked lines) undo+redo a 100-char delete on 30000 chars208.85000.20890.000209
Fugue text (baseline) undo+redo a 500-char delete on 30000 chars390.30000.39030.000390
Rich text undo+redo a 500-char delete on 30000 chars471.20000.47120.000471
Rich text (marked lines) undo+redo a 500-char delete on 30000 chars2143.35002.14330.002143

scaling_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Import 1000 chained changes922.98610.92300.000923
Import 10000 chained changes11112.191311.11220.011112
exportChangesNewerThan on 50000 changes / 10 peers (99% caught-up)1.80790.00180.000002
takeSnapshot(pruneHistory) with 10000 changes21915.345521.91530.021915
takeSnapshot(pruneHistory) with 100 concurrent heads3563.05963.56310.003563

serialization_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Binary encode/decode 1000 changes1584.07801.58410.001584

snapshot_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Take snapshot with 1000 changes135.84710.13580.000136

text_handler_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
CRDTTextHandler do 1000 operations and get value (incremental cache update: true)2937.25622.93730.002937
CRDTTextHandler do 1000 operations and get value (incremental cache update: false)3049.78543.04980.003050

topological_sort_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Import 1000 concurrent changes937.77780.93780.000938

undo_manager_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
Fugue text type 300 chars locally (undo managers: 0)658.10000.65810.000658
Fugue text type 300 chars locally (undo managers: 1)796.00000.79600.000796
Fugue text type 300 chars locally (undo managers: 2)864.13330.86410.000864
Fugue text type 300 chars locally (undo managers: 3)876.60000.87660.000877
Fugue text type 300 chars locally (undo managers: 5)905.80000.90580.000906
Fugue text undo+redo one keystroke on 2000 chars6.15000.00620.000006
Fugue text undo+redo one keystroke on 10000 chars4.55000.00460.000005
Fugue text undo+redo a 1-char delete on 5000 chars4.50000.00450.000005
Fugue text undo+redo a 100-char delete on 5000 chars57.05000.05700.000057
Fugue text undo+redo a 500-char delete on 5000 chars362.75000.36280.000363
Map undo+redo one set on 5000 keys3.75000.00370.000004
OR-set undo+redo one add on 5000 values4.60000.00460.000005
Fugue text undo/redo ping-pong x10 on 2000 chars477.66670.47770.000478
Fugue text undo/redo ping-pong x100 on 2000 chars1333.00001.33300.001333
Fugue text undo/redo ping-pong x1000 on 2000 chars12569.333312.56930.012569

version_vector_benchmark.dart​

BenchmarkRunTime (us)RunTime (ms)RunTime (s)
VersionVector toBytes 10 peers x1000439.03800.43900.000439
VersionVector fromBytes 10 peers x1000672.18570.67220.000672
VersionVector intersection 10 peers x1000210.66910.21070.000211