Skip to content

Conversation

@franz1981
Copy link
Contributor

Motivation:

ReferenceCountUtil::safeRelease can both hit interface virtual calls and requires checking for an interface type (ReferenceCounted)

Modifications:

Perform a class check to save both.

Result:

Faster buffers release

@franz1981
Copy link
Contributor Author

franz1981 commented Jan 16, 2024

This just remove the itable_stub presence on release, on the right, eg

image

Despite being a tiny amount, overall, in the global picture, for the write/flush path, is still an unecessary cost, see

image

where the itable_stub cost ~1.5% of the cost in such path, a tiny fraction, but as costy as performing useful work.

@hyperxpro
Copy link
Contributor

In these scenarios, I really love pattern-type matches.

Motivation:

ReferenceCountUtil::safeRelease can both hit interface virtual calls and requires checking for an interface type (ReferenceCounted)

Modifications:

Perform a class check to save both.

Result:

Faster buffers release
@normanmaurer normanmaurer merged commit e2859f4 into netty:4.1 Jan 19, 2024
franz1981 added a commit to franz1981/netty that referenced this pull request Feb 9, 2024
Motivation:

ReferenceCountUtil::safeRelease can both hit interface virtual calls and
requires checking for an interface type (ReferenceCounted)

Modifications:

Perform a class check to save both.

Result:

Faster buffers release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants