-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: explaining the page trick #2196
Conversation
Interesting! I bet we could use this trick in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One bit that seemed inaccurate but maybe I just didn't read it right.
doc/basics.md
Outdated
In effect, it means that you can almost always read a few bytes beyond your current buffer. | ||
Thus, even though you may sometimes need to reallocate the memory to get extra padding, this should be | ||
uncommon. However, tools such as valgrind or memory sanitizers will flag such behavior as unsafe. | ||
While the early releases of the simdjson made use of this capability, we removed it due to avoid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we got rid of this behavior in stage 1, but we still read into the padding sometimes (in string unescaping at the least).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll trim this comment since it seems unclear.
@@ -2621,6 +2623,120 @@ Performance tips | |||
``` | |||
- To better understand the operation of your On Demand parser, and whether it is performing as well as you think it should be, there is a logger feature built in to simdjson! To use it, define the pre-processor directive `SIMDJSON_VERBOSE_LOGGING` prior to including the `simdjson.h` header, which enables logging in simdjson. Run your code. It may generate a lot of logging output; adding printouts from your application that show each section may be helpful. The log's output will show step-by-step information on state, buffer pointer position, depth, and key retrieval status. Importantly, unless `SIMDJSON_VERBOSE_LOGGING` is defined, logging is entirely disabled and thus carries no overhead. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like if possible we should shove this elsewhere--maybe in performance.md
. It feels out of place for someone who wants to read and know all the basics. Not the biggest deal though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkeiser Right. I'll move it to performance.md
. Next commit.
@jkeiser The last commit moves things as you suggested. I also simplified some of the discussion so that it is less confusing. |
Merging. There are issues with Visual Studio which are unrelated. |
Padding does not usually require allocation.