Skip to content
Discussion options

You must be logged in to vote

Three overlapping reasons:

  1. Templated kernels live in headers. simdjson does runtime CPU dispatch across multiple SIMD kernels - there are 9 of them right now (westmere, haswell, icelake, arm64, ppc64, lasx, lsx, rvv-vls, fallback; see src/*.cpp and include/simdjson/<kernel>/)

    The On-Demand API is template-heavy, and templates have to be visible in every translation unit that instantiates them - so the per-kernel template definitions get amalgamated into simdjson.h while the .cpp only contains non-template wiring

  2. Header-only mode is supported. Define SIMDJSON_HEADER_ONLY before including, and the entire library compiles inline from the header - which means simdjson.h has to contain ev…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lemire
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants