containers icon indicating copy to clipboard operation
containers copied to clipboard

Tests and benchmarks for {Set,Map}.fromAscList and friends

Open meooow25 opened this issue 2 years ago • 6 comments

I wrote these up while working on making fromAscList fuse well. But I'm seeing some odd behavior there, so I thought I would split this straightforward PR out and work on the rest afterwards.

Current benchmarks on GHC 9.2.5 Set:

  fromAscList:  OK (0.21s)
    50.1 μs ± 2.7 μs, 240 KB allocated, 2.4 KB copied, 8.0 MB peak memory
  fromDescList: OK (0.21s)
    49.1 μs ± 4.1 μs, 240 KB allocated, 2.4 KB copied, 8.0 MB peak memory

Map:

  fromAscList:         OK
    39.6 μs ± 2.7 μs, 343 KB allocated, 5.2 KB copied,  10 MB peak memory
  fromAscListWithKey:  OK
    47.0 μs ± 4.3 μs, 455 KB allocated,  12 KB copied,  10 MB peak memory
  fromDescList:        OK
    39.6 μs ± 2.6 μs, 343 KB allocated, 5.5 KB copied,  10 MB peak memory
  fromDescListWithKey: OK
    48.1 μs ± 3.2 μs, 455 KB allocated,  13 KB copied,  10 MB peak memory

meooow25 avatar Jul 14 '23 19:07 meooow25

I would like to pick this and related PRs back up and try to get it over the finish line. @treeowl, hope you are well. Would you be available to review these?

meooow25 avatar Oct 07 '23 03:10 meooow25

I will be available to do it on Monday. Please ping me then if you remember.

treeowl avatar Oct 07 '23 14:10 treeowl

Rebased and updated. @treeowl please take a look.

meooow25 avatar Oct 09 '23 15:10 meooow25

Why drop Magma? This whole PR slipped under my radar. I'll try to take a look shortly.

treeowl avatar Sep 11 '24 15:09 treeowl

Why drop Magma?

Switched to arbitrary functions, makes things simpler.

It had also accumulated a bunch of edits, so I squashed a whole thing. You can take a fresh look.

meooow25 avatar Sep 11 '24 15:09 meooow25

I'm planning to merge this soon so I can implement https://github.com/haskell/containers/pull/963#issuecomment-2323026386 which will use these.

meooow25 avatar Oct 23 '24 16:10 meooow25