clintropolis opened a new pull request, #14919:
URL: https://github.com/apache/druid/pull/14919
### Description
Switches `DictionaryIdLookup` to serialize the value dictionaries and then
use mmap to load into their respective `Indexed` implementations instead of
using the the `{x}2IntMap` heap collections we were previously using, resulting
in dramatically more predictable heap usage at very minor performance cost.
Before (the peaks are merge/publish, 10m rows, 5m max segment size):

After (the dips are merge/publish with the peaks at the end being bitmap
index creation):

It does add a bit extra time to the task I used in my experiment:
<img width="585" alt="Screenshot 2023-08-23 at 5 52 53 PM"
src="https://github.com/apache/druid/assets/1577461/54513bcf-f357-4fd4-a513-41ab50eb3c98">
but it seems worth the cost, and probably in practice potentially faster
than the heap based approach when the task has a lot less room to spare and
faces more expensive gc cycles. I will be looking for other areas to improve in
exchange for this change.
I also refactored a few things to clean some stuff up (mainly consolidating
code around reading string dictionaries when the dictionary might be
front-coded or classic generic indexed based that was duplicated in a bunch of
places).
<hr>
This PR has:
- [ ] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]