Skip to content

Conversation

@shikharish
Copy link
Collaborator

  • Added a bench_uint16.cpp
  • Optimized uint16_t parsing with a similar approach to uint8_t.

benchmark results(Apple M1, Apple clang 14)
old:

parse_uint16_std_fromchars               :   0.46 GB/s   79.0 Mip/s  12.65 ns/ip   1.96 GHz  24.76 c/ip  111.74 i/ip   4.24 c/b  19.16 i/b   4.51 i/c 
parse_uint16_fastfloat                   :   0.75 GB/s  129.2 Mip/s   7.74 ns/ip   1.96 GHz  15.15 c/ip  90.51 i/ip   2.60 c/b  15.52 i/b   5.98 i/c 

new:

parse_uint16_std_fromchars               :   0.46 GB/s   78.9 Mip/s  12.67 ns/ip   1.96 GHz  24.80 c/ip  111.74 i/ip   4.25 c/b  19.16 i/b   4.51 i/c 
parse_uint16_fastfloat                   :   1.10 GB/s  189.2 Mip/s   5.29 ns/ip   1.96 GHz  10.35 c/ip  54.33 i/ip   1.77 c/b   9.32 i/b   5.25 i/c 

About 47% speedup on my machine

@shikharish
Copy link
Collaborator Author

cc: @lemire

@lemire
Copy link
Member

lemire commented Jan 1, 2026

Let me see if I can't get the s390x tests to work.

This would test BIG ENDIAN.

@lemire
Copy link
Member

lemire commented Jan 1, 2026

@shikharish Please sync with our main branch.

@shikharish
Copy link
Collaborator Author

@lemire done.

Copy link
Member

@lemire lemire left a comment

Choose a reason for hiding this comment

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

Looks good. I will let it sit in case others have comments.

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