optimize custom_json_operation validation
When using --advanced-benchmark
, I usually see the custom_json_operation::validate()
call near the top of the list. I believe the majority of the time is spent checking that the json string is valid:
https://gitlab.syncad.com/hive/hive/-/blob/9d6954c3ce460ca9d7ca3b629907bf2c9d05d9fa/libraries/protocol/hive_operations.cpp#L359
This validity checking works by deserializing the json into a variant, and verifying that the process doesn't throw and doesn't leave any unconsumed input. Building the variant is expensive, since it requires a lot of dynamic allocation. We could create a version of fc's recursive descent json parser that just checks validity but doesn't construct the variant, and I think that would be significantly faster.
The testing I did wasn't very rigorous, so verify my analysis before implementing a whole new parser.