Skip to content

Conversation

@clyring
Copy link
Member

@clyring clyring commented Feb 1, 2022

This has the effect of making newly-created singletons only require 4 rather than 9 words of heap space. Additionally, since the body of singleton now simplifies to a constructor application without any runRW# noise, this change enables GHC to perform more optimizations when singleton gets inlined than were previously possible.

Copy link
Contributor

@Bodigrim Bodigrim left a comment

Choose a reason for hiding this comment

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

Nice trick!

@Bodigrim Bodigrim requested a review from sjakobi February 2, 2022 00:48
@Bodigrim Bodigrim added this to the 0.11.3.0 milestone Feb 3, 2022
@Bodigrim Bodigrim merged commit 8861354 into haskell:master Feb 3, 2022
@Bodigrim
Copy link
Contributor

Bodigrim commented Feb 3, 2022

Thanks!

sjakobi pushed a commit that referenced this pull request Feb 15, 2022
* Make 'singleton' return a slice of a static buffer

* Tweak formatting, update internal documentation

* Elaborate on comment about heap space usage

(cherry picked from commit 8861354)
Bodigrim pushed a commit that referenced this pull request Feb 15, 2022
* Make 'singleton' return a slice of a static buffer

* Tweak formatting, update internal documentation

* Elaborate on comment about heap space usage

(cherry picked from commit 8861354)
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.

3 participants