Skip to content

Inline common msgpack encode dispatch - #298

Merged
jcrist merged 1 commit into
mainfrom
mpack-inline-encode-opt
Feb 4, 2023
Merged

jcrist merged 1 commit into
mainfrom
mpack-inline-encode-opt

Conversation

@jcrist

@jcrist jcrist commented Feb 4, 2023

Copy link
Copy Markdown
Member

This selectively inlines and reorganizes code in the mpack_encode dispatch, following the same optimization already applied to the JSON encoder (#294).

On my machine this results in up to a 15% speedup in encoding speed.

Inlining is done selectively, only in collections where the value types are likely to be homogenous (resulting in better branch prediction). The increase in library size is tiny (136 bytes), and no regressions were found in our benchmark suite.

This selectively inlines and reorganizes code in the `mpack_encode`
dispatch, following the same optimization already applied to the JSON
encoder.

On my machine this results in up to a 15% speedup in encoding speed.

Inlining is done selectively, only in collections where the value types
are likely to be homogenous (resulting in better branch prediction). The
increase in library size is tiny (136 bytes), and no regressions were
found in our benchmark suite.
@jcrist
jcrist merged commit 12b065c into main Feb 4, 2023
@jcrist
jcrist deleted the mpack-inline-encode-opt branch February 4, 2023 22:53
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.

1 participant