edgedb-js icon indicating copy to clipboard operation
edgedb-js copied to clipboard

Optimize default isolation/readonly serialization

Open CarsonF opened this issue 7 months ago • 3 comments

https://github.com/geldata/gel-js/blob/master/packages/gel/src/baseConn.ts#L597-L617 Cause the "Session/Options/State" identity to change with every query, causing it to be re-serialized & re-encoded with every query (misses on stateCache: WeakMap).

Maybe another cache layer could be introduced for one or both of these options, so that a consistent Options/State input produces the same identities (for the calc-ed defaults).

CarsonF avatar May 12 '25 14:05 CarsonF

Yeah, thanks for identifying this! We kinda knew we were accidentally breaking query caching here, but we haven't circled back to clean this up.

scotttrinh avatar May 12 '25 14:05 scotttrinh

I figured you knew. Just didn't want to lose it. I know you are wearing 10 hats 🙂

CarsonF avatar May 12 '25 14:05 CarsonF

Another wrench: annotations.

They contribute to the options identity but are serialized/encoded/sent separate from the class. https://github.com/geldata/gel-js/blob/master/packages/gel/src/baseConn.ts#L496-L503

CarsonF avatar May 12 '25 15:05 CarsonF