Skip to content

Commit 0c0fe0d

Browse files
committed
Update Chapter8.md
1 parent c0a8562 commit 0c0fe0d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Chapter8.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,7 @@ Insertion or removal of elements - linear O(n).
772772
As shown in the above description, in extreme cases, retaining a single element requires allocating the entire array, resulting in very low memory efficiency. For example, in bulk inserts, where a large number of records need to be inserted, the official implementation stores each record in a separate deque. Even if the record content is minimal, a deque must still be allocated. The MySQL deque implementation allocates 1KB of memory for each deque to support fast lookups.
773773

774774
```
775-
The implementation is the same as classic std::deque: Elements are
776-
held in blocks of about 1 kB each.
775+
The implementation is the same as classic std::deque: Elements are held in blocks of about 1 kB each.
777776
```
778777

779778
The official implementation uses 1KB of memory to store index information, and even if the record length is not large but there are many records, the memory access addresses may become non-contiguous, leading to poor cache friendliness. This design was intended to improve cache friendliness, but it has not been fully effective.

0 commit comments

Comments
 (0)