diff --git a/extra/benchmark/linked-assocs/linked-assocs.factor b/extra/benchmark/linked-assocs/linked-assocs.factor new file mode 100644 index 0000000000..4e4a38cf14 --- /dev/null +++ b/extra/benchmark/linked-assocs/linked-assocs.factor @@ -0,0 +1,19 @@ +USING: assocs combinators fry kernel linked-assocs math +sequences ; + +IN: benchmark.linked-assocs + +: (linked-assocs-benchmark) ( -- ) + 10,000 iota { + [ '[ 0 swap _ set-at ] each ] + [ '[ _ at ] map-sum 0 assert= ] + [ '[ dup _ set-at ] each ] + [ '[ _ at ] map-sum 49995000 assert= ] + [ '[ _ delete-at ] each ] + [ nip assoc-size 0 assert= ] + } 2cleave ; + +: linked-assocs-benchmark ( -- ) + 100 [ (linked-assocs-benchmark) ] times ; + +MAIN: linked-assocs-benchmark