Skip to content

Arity raising for record types#1114

Draft
konradbausch wants to merge 33 commits intomainfrom
konradbausch/arity-raising
Draft

Arity raising for record types#1114
konradbausch wants to merge 33 commits intomainfrom
konradbausch/arity-raising

Conversation

@konradbausch
Copy link

No description provided.

@jiribenes jiribenes added the experiment Experimental branch, do not merge! label Sep 30, 2025
@konradbausch konradbausch force-pushed the konradbausch/arity-raising branch from 6fb3660 to b659f5b Compare October 7, 2025 10:07
@konradbausch konradbausch force-pushed the konradbausch/arity-raising branch from a97ec28 to fd15b32 Compare November 25, 2025 14:56
@konradbausch konradbausch force-pushed the konradbausch/arity-raising branch from 87114b1 to 56b592c Compare December 2, 2025 23:31
@konradbausch konradbausch force-pushed the konradbausch/arity-raising branch 2 times, most recently from 0f00177 to 5cf0011 Compare December 15, 2025 11:02
@konradbausch konradbausch force-pushed the konradbausch/arity-raising branch from 85cc313 to 60352c2 Compare January 12, 2026 09:53
@b-studios
Copy link
Collaborator

b-studios commented Jan 12, 2026

Hey, thanks this looks great.

  1. do you have some insights on how this affects performance?
  2. could you delete the metals.sbt files from git?

@konradbausch konradbausch force-pushed the konradbausch/arity-raising branch from 34b3ea6 to 20fc2e0 Compare January 16, 2026 12:23
@konradbausch konradbausch force-pushed the konradbausch/arity-raising branch from 5e067df to 417cfa2 Compare January 19, 2026 17:14
@konradbausch
Copy link
Author

Thanks!

It seems to affect performance positively. Our current benchmarks that use records are not running faster, since as far as I saw, they get inlined or constant-folded. But they also aren't slower. I came up with some examples that show how performance increases when the changes actually persist through compilation. The record-passing example program might seem a bit constructed, so I also added a matrix determinant example, hoping it's a bit more realistic to an actual program.

Here are the results for doing 10 warmup runs and then 50 normal runs:

record_passing

Command Mean [ms] Min [ms] Max [ms] Relative
main 199.1 ± 4.4 189.8 210.4 9.18 ± 0.33
konradbausch/arity-raising 21.7 ± 0.6 21.0 24.0 1.00

matrix_determinant

Command Mean [ms] Min [ms] Max [ms] Relative
main 378.3 ± 8.8 362.5 408.3 14.34 ± 0.53
konradbausch/arity-raising 26.4 ± 0.8 25.2 28.1 1.00

It seems to only have improvements on the LLVM backend, and I'm not sure why yet. I haven't tried to find examples with negative performance effects yet and will look into that as well.

I've also removed the metals.sbt files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experiment Experimental branch, do not merge!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants