Skip to content

Remove calls to tobj() when we know we must have a GCBOX. - #177

Merged
bors[bot] merged 1 commit into
softdevteam:masterfrom
ltratt:remove_tobj_calls
Aug 10, 2020
Merged

Remove calls to tobj() when we know we must have a GCBOX.#177
bors[bot] merged 1 commit into
softdevteam:masterfrom
ltratt:remove_tobj_calls

Conversation

@ltratt

@ltratt ltratt commented Aug 6, 2020

Copy link
Copy Markdown
Member

Needs softdevteam/libgc#19 to be merged first.

At the moment a Val can only be INT or GCBOX, so in cases where we've checked to see if self is an INT, the only remaining case is GCBOX. The locations changed in this commit implicitly checked that self was a GCBOX
twice: by using unsafe gcbox_to_tobj function, we can remove the second (pointless) check. This is a just about measurable improvement on the JSON benchmark at about 1%.

At the moment a `Val` can only be `INT` or `GCBOX`, so in cases where we've
checked to see if `self` is an `INT`, the only remaining case is `GCBOX`. The
locations changed in this commit implicitly checked that `self` was a `GCBOX`
twice: by using unsafe `gcbox_to_tobj` function, we can remove the second
(pointless) check. This is a just about measurable improvement on the JSON
benchmark at about 1%.
@ptersilie

Copy link
Copy Markdown
Member

Looks good.

@ptersilie

Copy link
Copy Markdown
Member

bors r+

@bors

bors Bot commented Aug 10, 2020

Copy link
Copy Markdown
Contributor

Build succeeded:

@bors
bors Bot merged commit c2ffe13 into softdevteam:master Aug 10, 2020
@ltratt
ltratt deleted the remove_tobj_calls branch August 11, 2020 10:24
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.

2 participants