Skip to content

Optimization and benchmarking #3174

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

Merged
merged 23 commits into from
Aug 26, 2021
Merged

Optimization and benchmarking #3174

merged 23 commits into from
Aug 26, 2021

Conversation

pbiggar
Copy link
Member

@pbiggar pbiggar commented Aug 24, 2021

I was doing some benchmarking and discovered that running fuzzbuzz in Dark was taking a ridiculously long time, like 800ms. It was only taking 70ms in OCaml (including the http and serialization overhead, which was probably most of it).

The problem was that pure functions were all being marked as impure, and so every function call was having its arguments and result saved.

This adds the benchmarking, the fix and also some other major changes:

  • removes TaskOrValue and switches the Ply (which is a ValueTask), which is roughly the same. Ply is surprisingly slightly slower, but it's in the noise:
    • taskv -> uply
    • value -> Ply.Ply
    • TaskOrValue<a'> -> Ply.Ply<'a>
  • There were a few sequential async List and Map functions, those are now in the Task namespace and also in the Ply namespace (Ply.List.iterSequentially for example). This replaces uses of map_s and similar.
  • removes a couple of unnecessary taskv from interpreter
  • note a few places where we could do some optimization
  • fix an error when were would only load traces from impure functions
  • fix List.sortByComparator which wrapped a uply in a try (instead of the other way around). Also added a note to the coding guide about this.

@pbiggar pbiggar merged commit 67d2e93 into main Aug 26, 2021
@pbiggar pbiggar deleted the paul/benchmark branch August 26, 2021 14:28
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.

1 participant