[SERVER-47001] Reduce number of small buffer allocations for index builds Created: 19/Mar/20 Updated: 29/Oct/23 Resolved: 14/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Henrik Edin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Sprint: | Execution Team 2020-04-06, Execution Team 2020-04-20 | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||||||||||
| Description |
|
Index builds allocate a single, small buffer for each key generated. For index builds with small keys, much of the index build CPU time is spent just in memory allocation. It is generally faster to allocate fewer, larger memory regions than numerous, smaller ones. We can speed up index builds by allocating a few large buffers for key generation and sorting the pointers to keys within those buffers. This has the added benefit of having better cache locality for sorting since all keys will be nearby in memory. |
| Comments |
| Comment by Githook User [ 10/Apr/20 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: It uses a memory pool in the execution context to be able to share a Added SharedBufferFragment and SharedBufferFragmentBuilder to achieve this. |