Skip to content

Commit

Permalink
avoid copying memory
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Sep 16, 2023
1 parent c5e05c0 commit c85c3bc
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 107 deletions.
102 changes: 51 additions & 51 deletions packages/store/gas-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
"file": "test/KeyEncoding.t.sol",
"test": "testRegisterAndGetFieldLayout",
"name": "register KeyEncoding table",
"gasUsed": 688581
"gasUsed": 688555
},
{
"file": "test/Mixed.t.sol",
Expand All @@ -363,13 +363,13 @@
"file": "test/Mixed.t.sol",
"test": "testRegisterAndGetFieldLayout",
"name": "register Mixed table",
"gasUsed": 550415
"gasUsed": 550389
},
{
"file": "test/Mixed.t.sol",
"test": "testSetAndGet",
"name": "set record in Mixed",
"gasUsed": 104128
"gasUsed": 104102
},
{
"file": "test/Mixed.t.sol",
Expand Down Expand Up @@ -609,25 +609,25 @@
"file": "test/StoreCoreDynamic.t.sol",
"test": "testPopFromSecondField",
"name": "pop from field (cold, 1 slot, 1 uint32 item)",
"gasUsed": 20485
"gasUsed": 20433
},
{
"file": "test/StoreCoreDynamic.t.sol",
"test": "testPopFromSecondField",
"name": "pop from field (warm, 1 slot, 1 uint32 item)",
"gasUsed": 14497
"gasUsed": 14445
},
{
"file": "test/StoreCoreDynamic.t.sol",
"test": "testPopFromThirdField",
"name": "pop from field (cold, 2 slots, 10 uint32 items)",
"gasUsed": 22681
"gasUsed": 22629
},
{
"file": "test/StoreCoreDynamic.t.sol",
"test": "testPopFromThirdField",
"name": "pop from field (warm, 2 slots, 10 uint32 items)",
"gasUsed": 14693
"gasUsed": 14641
},
{
"file": "test/StoreCoreGas.t.sol",
Expand All @@ -645,7 +645,7 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testAccessEmptyData",
"name": "access dynamic field of non-existing record",
"gasUsed": 2071
"gasUsed": 2045
},
{
"file": "test/StoreCoreGas.t.sol",
Expand All @@ -663,7 +663,7 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testDeleteData",
"name": "delete record (complex data, 3 slots)",
"gasUsed": 6908
"gasUsed": 6882
},
{
"file": "test/StoreCoreGas.t.sol",
Expand All @@ -681,67 +681,67 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testHooks",
"name": "register subscriber",
"gasUsed": 58656
"gasUsed": 58604
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testHooks",
"name": "set record on table with subscriber",
"gasUsed": 71554
"gasUsed": 71502
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testHooks",
"name": "set static field on table with subscriber",
"gasUsed": 21297
"gasUsed": 21245
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testHooks",
"name": "delete record on table with subscriber",
"gasUsed": 16849
"gasUsed": 16797
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testHooksDynamicData",
"name": "register subscriber",
"gasUsed": 58656
"gasUsed": 58604
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testHooksDynamicData",
"name": "set (dynamic) record on table with subscriber",
"gasUsed": 164650
"gasUsed": 164598
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testHooksDynamicData",
"name": "set (dynamic) field on table with subscriber",
"gasUsed": 24497
"gasUsed": 24445
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testHooksDynamicData",
"name": "delete (dynamic) record on table with subscriber",
"gasUsed": 17834
"gasUsed": 17782
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testPushToField",
"name": "push to field (1 slot, 1 uint32 item)",
"gasUsed": 12241
"gasUsed": 12189
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testPushToField",
"name": "push to field (2 slots, 10 uint32 items)",
"gasUsed": 34995
"gasUsed": 34943
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testRegisterAndGetFieldLayout",
"name": "StoreCore: register table",
"gasUsed": 612566
"gasUsed": 612540
},
{
"file": "test/StoreCoreGas.t.sol",
Expand All @@ -765,7 +765,7 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetDynamicData",
"name": "set complex record with dynamic data (4 slots)",
"gasUsed": 102048
"gasUsed": 102022
},
{
"file": "test/StoreCoreGas.t.sol",
Expand Down Expand Up @@ -807,7 +807,7 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetField",
"name": "set static field (1 slot)",
"gasUsed": 31770
"gasUsed": 31744
},
{
"file": "test/StoreCoreGas.t.sol",
Expand All @@ -819,7 +819,7 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetField",
"name": "set static field (overlap 2 slot)",
"gasUsed": 30410
"gasUsed": 30384
},
{
"file": "test/StoreCoreGas.t.sol",
Expand All @@ -831,31 +831,31 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetField",
"name": "set dynamic field (1 slot, first dynamic field)",
"gasUsed": 53295
"gasUsed": 53269
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetField",
"name": "get dynamic field (1 slot, first dynamic field)",
"gasUsed": 2240
"gasUsed": 2214
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetField",
"name": "set dynamic field (1 slot, second dynamic field)",
"gasUsed": 31522
"gasUsed": 31496
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetField",
"name": "get dynamic field (1 slot, second dynamic field)",
"gasUsed": 2242
"gasUsed": 2216
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetStaticData",
"name": "set static record (1 slot)",
"gasUsed": 32354
"gasUsed": 32328
},
{
"file": "test/StoreCoreGas.t.sol",
Expand All @@ -867,7 +867,7 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testSetAndGetStaticDataSpanningWords",
"name": "set static record (2 slots)",
"gasUsed": 54858
"gasUsed": 54832
},
{
"file": "test/StoreCoreGas.t.sol",
Expand All @@ -879,13 +879,13 @@
"file": "test/StoreCoreGas.t.sol",
"test": "testUpdateInField",
"name": "update in field (1 slot, 1 uint32 item)",
"gasUsed": 13279
"gasUsed": 13227
},
{
"file": "test/StoreCoreGas.t.sol",
"test": "testUpdateInField",
"name": "push to field (2 slots, 6 uint64 items)",
"gasUsed": 14081
"gasUsed": 14029
},
{
"file": "test/StoreHook.t.sol",
Expand Down Expand Up @@ -933,97 +933,97 @@
"file": "test/tables/Callbacks.t.sol",
"test": "testSetAndGet",
"name": "Callbacks: set field",
"gasUsed": 56370
"gasUsed": 56344
},
{
"file": "test/tables/Callbacks.t.sol",
"test": "testSetAndGet",
"name": "Callbacks: get field (warm)",
"gasUsed": 2938
"gasUsed": 2912
},
{
"file": "test/tables/Callbacks.t.sol",
"test": "testSetAndGet",
"name": "Callbacks: push 1 element",
"gasUsed": 35306
"gasUsed": 35254
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testOneSlot",
"name": "StoreHooks: set field with one elements (cold)",
"gasUsed": 58368
"gasUsed": 58342
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTable",
"name": "StoreHooks: set field (cold)",
"gasUsed": 58368
"gasUsed": 58342
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTable",
"name": "StoreHooks: get field (warm)",
"gasUsed": 2922
"gasUsed": 2896
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTable",
"name": "StoreHooks: push 1 element (cold)",
"gasUsed": 15393
"gasUsed": 15341
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTable",
"name": "StoreHooks: pop 1 element (warm)",
"gasUsed": 11948
"gasUsed": 11896
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTable",
"name": "StoreHooks: push 1 element (warm)",
"gasUsed": 13419
"gasUsed": 13367
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTable",
"name": "StoreHooks: update 1 element (warm)",
"gasUsed": 34517
"gasUsed": 34465
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTable",
"name": "StoreHooks: delete record (warm)",
"gasUsed": 7319
"gasUsed": 7293
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTable",
"name": "StoreHooks: set field (warm)",
"gasUsed": 30530
"gasUsed": 30504
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testThreeSlots",
"name": "StoreHooks: set field with three elements (cold)",
"gasUsed": 81059
"gasUsed": 81033
},
{
"file": "test/tables/StoreHooks.t.sol",
"test": "testTwoSlots",
"name": "StoreHooks: set field with two elements (cold)",
"gasUsed": 80970
"gasUsed": 80944
},
{
"file": "test/tables/StoreHooksColdLoad.t.sol",
"test": "testDelete",
"name": "StoreHooks: delete record (cold)",
"gasUsed": 16184
"gasUsed": 16158
},
{
"file": "test/tables/StoreHooksColdLoad.t.sol",
"test": "testGet",
"name": "StoreHooks: get field (cold)",
"gasUsed": 8919
"gasUsed": 8893
},
{
"file": "test/tables/StoreHooksColdLoad.t.sol",
Expand All @@ -1041,13 +1041,13 @@
"file": "test/tables/StoreHooksColdLoad.t.sol",
"test": "testPop",
"name": "StoreHooks: pop 1 element (cold)",
"gasUsed": 22434
"gasUsed": 22382
},
{
"file": "test/tables/StoreHooksColdLoad.t.sol",
"test": "testUpdate",
"name": "StoreHooks: update 1 element (cold)",
"gasUsed": 24570
"gasUsed": 24518
},
{
"file": "test/tightcoder/DecodeSlice.t.sol",
Expand Down Expand Up @@ -1101,13 +1101,13 @@
"file": "test/Vector2.t.sol",
"test": "testRegisterAndGetFieldLayout",
"name": "register Vector2 field layout",
"gasUsed": 411838
"gasUsed": 411812
},
{
"file": "test/Vector2.t.sol",
"test": "testSetAndGet",
"name": "set Vector2 record",
"gasUsed": 33257
"gasUsed": 33231
},
{
"file": "test/Vector2.t.sol",
Expand Down
Loading

0 comments on commit c85c3bc

Please sign in to comment.