-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use FastWriter for TlvJson #18456
Use FastWriter for TlvJson #18456
Conversation
PR #18456: Size comparison from e4782f6 to ca71036 Full report (26 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
PR #18456: Size comparison from b4509f3 to 2243bfd Full report (11 builds for cyw30739, linux, mbed, nrfconnect, p6, telink)
|
PR #18456: Size comparison from b4509f3 to ad6a1c4 Full report (33 builds for cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, telink)
|
@mrjerryjohns - I removed your "#if 0" block, as I believe I achieved your original goal. Instead of comparing Json::Values though, I normalized the reference string to be in the format expected from the library. This ensures the library is generating the expected format, and also removes white-space requirements in the reference strings. I left your reference strings as-is since they are easier to read when examining a test failure or writing new tests. |
PR #18456: Size comparison from b4509f3 to 48bac1e Full report (33 builds for cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, telink)
|
TlvJson now outputs a more RPC-friendly string, instead of a human-readable string.
PR #18456: Size comparison from f829356 to 7219797 Full report (26 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
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.
👍 LGTM
TlvJson now outputs a compact machine-readable string, instead of one that's human-readable.
Problem
I'm using TlvJson to generate attribute values in JSON format, and I want the string to be compact. It's currently outputting human-readable JSON that's full of extra white space.
I don't believe this library was meant for debug purposes only, so I propose to change the TlvJson behavior rather than re-formatting the JSON on the app side. Folks that are using it to debug can always run it through
python -m json.tool
Change overview
Adjust TlvJson to output a compact machine-readable JSON format.
Before
After
Testing
ninja -v -k 0 check