Add an optimized historic storage to support flagsets when serving /splitChanges in the split-proxy app.
The new component is expected to return all the flags that must be returned given a change number & a list of flagsets. together with it's associations & traffic-type (this data is the minimum required to return a "fake" payload for splits that the user has to remove. This frees the proxy from keeping track of all split definitions it has seen since it started.
Based on previous stress-test results , and the reduced number of flagsets & splits, performance tends to be better with contiguos allocated memory chunks using binary search vs constructing maps to check for uniqueness & membership checks. The code gets a little uglier at some point, but reducing allocations & GC pressure proved to improve CPU usage quite a bit in the past. A benchmark was written to validate the approach. it can be run with the command cd splitio/proxy/storage/optimized && go test -bench=. -count=5 -benchmem.
Add an optimized historic storage to support flagsets when serving /splitChanges in the split-proxy app.
cd splitio/proxy/storage/optimized && go test -bench=. -count=5 -benchmem
.Sample results here for reference: