You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're using simdjson to parse multiple documents, or in a loop, you should allocate a parser once and reuse it (allocation is slow, do it as little as possible!):
171
+
### Reusing the parser for maximum efficiency
172
+
173
+
If you're using simdjson to parse multiple documents, or in a loop, you should make a parser once
174
+
and reuse it. simdjson will allocate and retain internal buffers between parses, keeping buffers
175
+
hot in cache and keeping allocation to a minimum.
172
176
173
177
```c++
174
-
// Allocate a parser big enough for all files
175
178
document::parser parser;
176
-
if (!parser.allocate_capacity(1024*1024)) { exit(1); }
0 commit comments