Skip to content

Misc performance improvements#24

Open
kit-ty-kate wants to merge 6 commits intohannesm:mainfrom
kit-ty-kate:misc-improvements
Open

Misc performance improvements#24
kit-ty-kate wants to merge 6 commits intohannesm:mainfrom
kit-ty-kate:misc-improvements

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Collaborator

@kit-ty-kate kit-ty-kate commented Apr 22, 2025

Queued on #23

@hannesm
Copy link
Copy Markdown
Owner

hannesm commented Jun 4, 2025

this looks fine to me, feel free to merge when you're ready.

@kit-ty-kate
Copy link
Copy Markdown
Collaborator Author

Running the full testsuite locally shows the following unsettling performance behaviour:

OCaml 5.4:

  • main (3.1.0): ~2.315s
  • misc-improvements: ~2.275s

OCaml 4.14:

  • main (3.1.0): ~3.000s
  • misc-improvements: ~3.200s

@kit-ty-kate
Copy link
Copy Markdown
Collaborator Author

Thanks to a quick godbolt today i learned that (at least for 4.14):

let is_prefix =
  let rec aux ~prefix str =
    ...
  in
  fun ~prefix str -> ...

doesn't seem to create an equivalent native binary to

let is_prefix ~prefix str =
  let rec aux ~prefix str =
    ...
  in
  ...

After splitting #41 away and removing the fun ... -> the new performance numbers are:

OCaml 5.4:

  • main (3.1.0): ~2.315s
  • misc-improvements: ~2.275s

OCaml 4.14:

  • main (3.1.0): ~3.000s
  • misc-improvements: ~3.000s

@kit-ty-kate kit-ty-kate changed the title Misc improvements Misc performance improvements Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants