Skip to content

Make basicUnsafeIndexM strict in element for Storable - #576

Open
Shimuuar wants to merge 2 commits into
masterfrom
indexing-storable
Open

Shimuuar wants to merge 2 commits into
masterfrom
indexing-storable

Conversation

@Shimuuar

Copy link
Copy Markdown
Contributor

I think it does make sense to make indexing strict. There's no unevaluated thunk which we may want to preserve, we create new value in place. Similarly primitive vectors forces result of indexing. Judging from bug report GHC <9.12 was able to optimize overhead away. So we seems to be at edge of its ability. No point in making its work harder.

This PR also adds regression test for checking that index doesn't allocate with -O2 (sadly it does with -O1)

Fixes #570

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.

Storable basicUnsafeIndexM does not force the element read, so == and compare allocate 56 bytes an element

1 participant