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

Optimise DeserializeShort.substring #1786

Merged
merged 1 commit into from
Aug 16, 2020

Conversation

mrBliss
Copy link
Contributor

@mrBliss mrBliss commented Aug 15, 2020

In my microbenchmark, this brings down the cost of deserialising a Shelley
address in viewCompactTxOut from ~360ns to ~60ns.

The cloneByteArray function was introduced in version 0.7.1.0 of the
primitive package, so update the lower bound accordingly.

I believe the old primitive < 0.7 constraint in cabal.project was due to
older versions of the cborg package having >=0.5 && <0.7.1.0 as bounds for
primitive, but cborg-0.2.4.0 bumped the upper bound to 0.8.

This will likely require similar changes to downstream repos.

@TimSheard
Copy link
Contributor

Using cloneByteArray is exactly what was needed. This should speed up things considerably. I cannot speak to the version numbers the projects. Thanks for doing this.

In my microbenchmark, this brings down the cost of deserialising a Shelley
address in `viewCompactTxOut` from ~360ns to ~60ns.

The `cloneByteArray` function was introduced in version 0.7.1.0 of the
`primitive` package, so update the lower bound accordingly.

I believe the old `primitive < 0.7` constraint in `cabal.project` was due to
older versions of the `cborg` package having `>=0.5 && <0.7.1.0` as bounds for
`primitive`, but `cborg-0.2.4.0` bumped the upper bound to 0.8.

This will likely require similar changes to downstream repos.
@mrBliss mrBliss merged commit 55a2566 into nc/benchValidation Aug 16, 2020
@iohk-bors iohk-bors bot deleted the mrBliss/optimise-substring branch August 16, 2020 18:09
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.

None yet

2 participants