Query allocator and evaluation allocator were different.
After analysis, was determined they should be the same, this will help
future development reduce TypeValue copies during queries.
Changes:
- Common allocator, PoolResource backed by MonotonicResource
- Optimized Pool, now O(1) alloc/dealloc as all chunks in Pool form a single
free list
- 2nd PoolResource, using bin sizing, not as perfect for memory usage but
O(1) bin selection
- Now have jemalloc's background thread to make sure decay and return
to OS happens
- Optimized ProperyValue to be faster at destruction/copy/move
- Less temporary memory allocations
- CSV reader now maintains a common line buffer it reuses on line reads
- Writing out bolt values, now reuses a values buffer
- Evaluating an int no longer makes temporary strings for errors it most
likely never throws
- ExpandVariable will reuse existing edge list in frame it one existed
Summary:
With a pool allocator, lookups in STL set and map are up to 50% faster.
This is probably due to contiguous memory of pooled objects, i.e. nodes
of those containers. In some cases, the lookup outperforms the SkipList.
Insertions are also faster, though not as dramatically, up to 30%. This
does make a significant difference when the STL containers are used in a
single thread as they outperform the SkipList significantly.
Reviewers: mferencevic, ipaljak
Reviewed By: mferencevic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D2326
Summary:
This is a preparation step in case we want to have a custom allocator in
SkipList. For example, pool based allocator for SkipListNode.
Introduction of MemoryResource and removal of `calloc` has reduced the
performance a bit according to micro benchmarks. This performance hit is
not visible on benchmarks which do more concurrent operations.
Reviewers: mferencevic, mtomic
Reviewed By: mferencevic
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D2140