You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
89MB. But this value might be decreased to 52MB (-37MB)
Index
2.67MB
4.69MB
2MB
Memory with LRU*
Case
Bitmap
Map
Benefit
LRU
10%-100%. 9MB-87MB
100% 175MB (harder to use)
Index
3MB
5MB
-2MB
Results
12MB-90MB
180MB
90MB-168MB
Memory Detailed
Case
Bitmap
Map
Benefit
Total
90MB
180MB
90MB
Price Storage
57MB
153MB
96MB. But this value might be decreased to 59MB (-37MB)
Index to UUID Map
7.44MB
0MB
-7.44MB difference
Index
2.67MB
4.69MB
2MB
UUIDs for prices
22MB
22MB
no difference
Notes. Memory
Bitmap allows to store Price which is needed for response-only. This is small and efficient object.
More over, it allows using LRU cache and evict entire Prices Storage and load what is often used only.
In case of 'map' stored prices contains all data needed for price search, that is why LRU cache is not that efficient.
It will force eviction and loading ALL prices per offering.
Calculations and memory results looks promising, but there is one huge pitfall -
benchmark executed with no memory limits. In case if strict memory limits will be introduced, in current version of
roaring bitmaps TPS should be limited, otherwise GC pressure will drop timings significantly.
There is one project that looks promising - sroar - huge memory allocations drop
Notes. Search based on simple map index
BenchmarkMapOfferingIndex_FindPrice_3824position
Search doesn't depend on element position and requires iteration over all elements
Search optimized based on data specifics, and this is when search stops on price position.
Worst case scenario is the same as for non-optimized benchmark
Search prices when not all conditions specified, so there are multiple prices found.
This test shows (as expected) that such search requires iteration over all elements
Notes. HTTP Client Server*
Includes send request, read response, unmarshal and test library validations that no errors.
This adds 77020 ns/op for bitmap and 143759 ns/op for map index. Such difference in overhead is unclear,
cause the code is the same. This benchmark requires deeper investigation to properly interpret results.
*This is a part of go test on mocks, just for illustration purposes here. Prefer Timing (high level)
Machine, Software and Run notes
OS: linux, arch: amd64
CPU: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
6 cores (12 processors)
The same machine used to run app and benchmark
Processors are limited to 2 for app plus 2 more on benchmark tool
Browser and other applications might work during execution