Tests and benchmarks for {Set,Map}.fromAscList and friends
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
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?
I will be available to do it on Monday. Please ping me then if you remember.
Rebased and updated. @treeowl please take a look.
Why drop Magma? This whole PR slipped under my radar. I'll try to take a look shortly.
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.
I'm planning to merge this soon so I can implement https://github.com/haskell/containers/pull/963#issuecomment-2323026386 which will use these.