Skip to content

Commit

Permalink
Merge pull request #342 from onflow/fxamacker/inline-array-and-map
Browse files Browse the repository at this point in the history
Inline child array and map data slab into parent slab
  • Loading branch information
fxamacker authored Oct 4, 2023
2 parents 1e6ec55 + 5f1de0a commit 0fc8f74
Show file tree
Hide file tree
Showing 20 changed files with 19,051 additions and 5,499 deletions.
1,098 changes: 978 additions & 120 deletions array.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions array_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func benchmarkNewArrayFromAppend(b *testing.B, initialArraySize int) {
for i := 0; i < b.N; i++ {
copied, _ := NewArray(storage, array.Address(), array.Type())

_ = array.Iterate(func(value Value) (bool, error) {
_ = array.IterateReadOnly(func(value Value) (bool, error) {
_ = copied.Append(value)
return true, nil
})
Expand All @@ -379,7 +379,7 @@ func benchmarkNewArrayFromBatchData(b *testing.B, initialArraySize int) {
b.StartTimer()

for i := 0; i < b.N; i++ {
iter, err := array.Iterator()
iter, err := array.ReadOnlyIterator()
require.NoError(b, err)

copied, _ := NewArrayFromBatchData(storage, array.Address(), array.Type(), func() (Value, error) {
Expand Down
Loading

0 comments on commit 0fc8f74

Please sign in to comment.