onflow / atree

Atree provides scalable arrays and scalable ordered maps.
https://onflow.org
Apache License 2.0
40 stars 16 forks source link

Add nested array and nested map to stress test program #231

Closed fxamacker closed 2 years ago

fxamacker commented 2 years ago

Closes #157

Description

Update stress test program to

Command line flags

Adding new elements outpaces random removal of elements. The maxheap flag is used to prevent the program from using up all available memory.

During random ops, HeapAlloc will eventually reach/exceed maxheap, causing random elements to be removed until minheap is reached before resuming.

% ./stress -h
Usage of ./stress:
  -maxheap uint
        max HeapAlloc in MiB to trigger extra removal of elements (default 2000)
  -maxlen uint
        max number of elements (default 10000)
  -minheap uint
        min HeapAlloc in MiB to stop extra removal of elements (default 1000)
  -seed string
        seed for prng in hex (default is Unix time)
  -type string
        array or map (default "array")            

Caveats

codecov-commenter commented 2 years ago

Codecov Report

Merging #231 (92255df) into main (d9e6627) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #231   +/-   ##
=======================================
  Coverage   68.60%   68.60%           
=======================================
  Files          14       14           
  Lines        7129     7129           
=======================================
  Hits         4891     4891           
  Misses       1611     1611           
  Partials      627      627           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d9e6627...92255df. Read the comment docs.

fxamacker commented 2 years ago

Need to make some more changes before merging.

turbolent commented 2 years ago

👏

turbolent commented 2 years ago

Smart to test until a certain memory threshold is reached and pruning to keep testing 👍