Improve RPC performance by avoiding JSON serialization cost
See CKB RPC, some RPC methods support verbosity = 0:
When
verbosityis 0, it returns a 0x-prefixed hex string as theresult. The string encodes the block serialized by molecule using schematable Block.
It should avoid extra JSON serialization and deserialization costs. Whether molecule deserialization will incur additional costs should be tested.
JSON is likely vastly more optimized. For example V8 just made JSON.stringify more than twice as fast as before. There is also this easy-to-listen video that covers the article.
Phroi
JSON is likely vastly more optimized. For example V8 just made JSON.stringify more than twice as fast as before. There is also this easy-to-listen video that covers the article.
Thank you for your sharing! @quake previously proposed this, and his point of view is that this can save the overhead of CKB node JSON serialization.
Benchmarks (from CKB node to nodejs) are definitely needed to figure out if this actually helps.