Skip to content

perf: inline serializer - #813

Closed
cesco69 wants to merge 7 commits into
fastify:mainfrom
cesco69:perf-inline
Closed

cesco69 wants to merge 7 commits into
fastify:mainfrom
cesco69:perf-inline

Conversation

@cesco69

@cesco69 cesco69 commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

Same as #812

This PR removes all serializer functions and fully inlines all serialization logic into a single main function.

For the future! this approach is not a performance improvements for the serializer

Benchmark

short string..............................................-6.22%
unsafe short string.......................................+7.22%
short string with double quote.............................-6.1%
long string without double quotes.........................+4.14%
unsafe long string without double quotes..................-4.09%
long string...............................................-1.27%
unsafe long string........................................+6.39%
number....................................................-5.23%
integer...................................................-9.13%
formatted date-time......................................+26.88%
formatted date............................................+0.66%
formatted time............................................+1.76%
short array of numbers....................................-0.83%
short array of integers...................................-2.58%
short array of short strings.............................-12.09%
short array of long strings..............................-12.54%
short array of objects with properties of different types..-2.9%
object with number property...............................-4.83%
object with integer property..............................-1.58%
object with short string property........................-16.04%
object with long string property..........................+3.37%
object with properties of different types.................-3.48%
simple object.............................................-0.09%
simple object with required fields........................-9.54%
object with const string property.........................+4.76%
object with const number property........................-12.32%
object with const bool property...........................+6.89%
object with const object property..........................+2.1%
object with const null property...........................-2.79%

Signed-off-by: francesco <francesco.bagnoli.69@gmail.com>
@cesco69 cesco69 changed the title perf: inline serializer perf: inline serializer (huge^2 perf improvements!) Jan 15, 2026
Signed-off-by: francesco <francesco.bagnoli.69@gmail.com>
Signed-off-by: francesco <francesco.bagnoli.69@gmail.com>
@cesco69 cesco69 changed the title perf: inline serializer (huge^2 perf improvements!) perf: inline serializer Jan 16, 2026
@cesco69 cesco69 closed this Jan 16, 2026
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant