Skip to content
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

CBOR decoder performance #1857

Merged
merged 3 commits into from
Jun 15, 2020
Merged

CBOR decoder performance #1857

merged 3 commits into from
Jun 15, 2020

Conversation

bgamari
Copy link
Contributor

@bgamari bgamari commented Jun 14, 2020

This fixes a few minor issues in CBOR decoder performance. Specifically,

  • Ensure that thunks are not built when decoding numbers
  • Use Data.Sequence.replicateA instead of Data.Sequence.fromList . Data.List.replicate, avoiding an intermediate list

Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks, @bgamari!

Just one inline question.

Comment on lines +338 to +339
xs <- Data.Sequence.replicateA (len - 2) go
return (ListLit Nothing xs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test whether this is beneficial? I had tried this before, but it seemed to actually slow things down: #1804 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your response in #1804 (comment) @bgamari!

It's well possible that when I benchmarked this before, I was mislead by my noisy machine! I any case, the effect will not be huge.

@mergify mergify bot merged commit 2068589 into dhall-lang:master Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants