haskell / haskell/bytestring

Revisit efficiency of `Integral` conversions in `stimes` implementation for `StrictByteString`

Open
#493 3 comments 0 reactions 0 assignees View on GitHub
blocked: ghc performance
Dominant language
Haskell
Stars
301
Forks
144
Avg merge
7d 22h
Merged PRs (30d)
1

Description

The goal is to avoid allocating intermediate `Integer`s when using `stimes` `@Int`, `@Word` or with other primitive types.

There's some ongoing work in GHC that should help us: https://gitlab.haskell.org/ghc/ghc/-/issues/20361. Once it is merged, we should check whether the goal has been achieved.

It may be useful to replace `checkedIntegerToInt` with `Data.Bits.toIntegralSized` then.

https://github.com/haskell/bytestring/blob/12563781f257f132f4da866047abe720623f9990/Data/ByteString/Internal.hs#L737-L787

https://github.com/haskell/bytestring/blob/12563781f257f132f4da866047abe720623f9990/Data/ByteString/Internal.hs#L868-L879

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.