-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation performance degrades rapidly while increasing record length #12
Comments
I've encountered this too. Compilation time for large records makes this library unusable :( |
Maybe the slowdown has to do something with |
No, the slowdown also exists w/o the SortInsert :-( |
When disabling optimization |
I am currently writing a similar library, and I benchmarked against superrecord (just the compile time)
and my library:
I am not sure where this difference comes from, my rows are also sorted and the runtime representation of records is also a |
I figured that the order of labels was the best case for my RowAppend type family as it would be a
|
Compilation performance is evident on records of bigger size, just one record of 30-50 fields is able to make GHC swap. There's a branch and a script I've used to dig more info on this:
https://github.com/dredozubov/superrecord/tree/ghc-test-case
https://github.com/dredozubov/superrecord/blob/ghc-test-case/build-all.sh
I did a small investigation on this. Tried it with GHC 8.0.2 and 8.2.1(it can be done with
allow-newer
). Building it with GHC HEAD is not currently possible due to the broken dependencies. Here we go:https://github.com/dredozubov/superrecord/blob/ghc-test-case/test/Spec.hs.in#L451 construction of a record with 35 fields take up to 2 minutes
RecCopy
produces a huge amount of coercions: https://gist.github.com/dredozubov/6ce629d1ec16ac32e9a987ffefda2a2aThere's a lot of rewriting going on(a lot of heavy inlining in the library). Here are some core2core dumps with their respective size:
These dumps are too big to add as gists, so I've uploaded this tar archive instead: https://www.dropbox.com/s/pql4qgm5lplbe38/dump-35.tar.gz?dl=0
It's possible to rebuild all of this with
nix-shell -p python3 --run "ghc=/Users/dr/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc m=25 n=35 ./build-all.sh -package-db ~/.stack/snapshots/x86_64-osx/lts-8.20/8.0.2/pkgdb/"
, skipping the nix-shell bit if you have python3 installed on your system and substituting theghc
variable andpackage-db
with correct values for you system.m
andn
variables mean it'll rebuild the module 10 with records of length 25 to 35.The text was updated successfully, but these errors were encountered: