On Tue, Nov 21, 2023 at 8:07 AM Patrick Steinhardt <ps@xxxxxx> wrote: > > When iterating over entries in the merged iterator's queue, we compute > the key of each of the entries and write it into a buffer. We do not > reuse the buffer though and thus re-allocate it on every iteration, > which is wasteful given that we never transfer ownership of the > allocated bytes outside of the loop. > >From a brief read, change looks good. In the C code, each key has to pass through the pqueue which is (assuming auto-compaction) has log2(#tables) entries. The JGit code assumes that the base table will be very large and the rest small. This means that most keys come from the base table, and has some special casing so those keys don't have to pass through the pqueue. If you worry about efficiency, this might be something to look into. -- Han-Wen Nienhuys - hanwenn@xxxxxxxxx - http://www.xs4all.nl/~hanwen