zlacker

[parent] [thread] 0 comments
1. srcrei+(OP)[view] [source] 2023-06-02 04:21:37
The table size optimization came from a wide keyed table with a single value as data. The proposed solution was simple (wide key, date, data). I showed that storing data as an array with start_date for indexing (one value per day in the array) reduces storage by 40x, and is also faster even with many years worth of data in the array.

The code size optimization used the standard dead code elimination, constant propagation and folding, peephole ASM optimizations. I also found that the hidden test suite had a defect where some valid code could be eliminated and it’s associated tests wouldn’t catch it, but forget the details. I informed them but they let me keep the savings.

I know how to send compiler errors in Racket IDEs using a macro (static code checks). I also made a macro which reads DB table column names and creates variables based on them, so the code would break based on typo checking against the actual table name.

The graphQL optimization came from suspiciously high serialization costs in python Apollo graphQL server. Something like 70% of time handling request in serialization. Someone else figured out a change to help here, it took some prodding them to keep looking for the right fix as 70% time in serialization seemed absolutely nuts.

[go to top]