Performance regressions in nightly btwn nightly-2017-12-25 and nightly-2017-12-26 #48155
Labels
C-bug
Category: This is a bug.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I think this is the right place to report that I am seeing some performance regressions in Frunk, namely in the benchmark for
LabelledGeneric
-based conversions, where I compare hand-written conversions between structs vs autoLabelledGeneric
-driven conversions.I've narrowed it to changes made between
nightly-2017-12-25
andnightly-2017-12-26
As you can see above, the
LabelledGeneric
-based conversion (big_transform_from_*
) went from being essentially the same as hand-written to ~70x the overhead 😢Not really sure if it matters how
LabelledGeneric
struct-to-struct transformation works in Frunk, but it essentially gets the compiler to verify that for two given structs, their fields are "compatible" (target struct field names and fields types are a subset of source struct's) and then "just" aligns the generic representation of source to target and dumps one into the other. I say "just" because I still have no idea how Rust managed to make this a zero-overhead op 😆The bloody details are available in multipart on my blog (part 1, part 2, part 3).
The text was updated successfully, but these errors were encountered: