Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
Description
A PageWriter uses two PublicBaos to buffer the encoding results of timestamps and values. However, the initial size of PublicBaos is the default (64B). Consequently, if the page is large, the PublicBaos will extend several times and each involves a full memory copy, which can be time-consuming.
To avoid unnecessary memory copy, the initial size of PublicBaos should be configurable. There are many ways to configure the value, and here are two alternatives:
1. Use half of the maximum page size as the initial size.
2. Record the (average) page size of the last flush in a context, and pass it down to PageWriter in the next flush.