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
I have searched existing issues to ensure the issue has not already been raised
Issue
As you know, I've developed a wrapper library of this fast-json-stringify, which can perform by only one line. In nowadays, I'm trying to upgrade the JSON string conversion function by myself, to avoid the #417 error, not to use ajv and JSON schema definition at all.
Anyway, during the development, I've found an interesting thing. Empty spaced JSON string conversion function is about 2x times faster than non empy scaped function. Therefore, I report you such phenomenon. When I'd met such phenomenon accidently, I was confused. But now, I could understand why the empty spaces make JSON string conversion faster.
Empty spaces make JSON string to be logner and it reduces number of character array (char*) re-constructions.
From many experiments, I've found that using 8 spaces between object properties is the comon best. I'm experimenting to other types like array and tuple, but the 8 spaces are still effective.
Prerequisites
Issue
As you know, I've developed a wrapper library of this
fast-json-stringify
, which can perform by only one line. In nowadays, I'm trying to upgrade the JSON string conversion function by myself, to avoid the #417 error, not to useajv
and JSON schema definition at all.Anyway, during the development, I've found an interesting thing. Empty spaced JSON string conversion function is about 2x times faster than non empy scaped function. Therefore, I report you such phenomenon. When I'd met such phenomenon accidently, I was confused. But now, I could understand why the empty spaces make JSON string conversion faster.
From many experiments, I've found that using 8 spaces between object properties is the comon best. I'm experimenting to other types like array and tuple, but the 8 spaces are still effective.
Empty spaced
Non-empty spaced
The text was updated successfully, but these errors were encountered: