Describe the bug
- The
Append built-in uses excessive CPU due to frequent runtime.growslice calls.
Steps to reproduce
- Run an INSERT that writes a large number of rows.
- This triggers multiple append operations that allocate new underlying arrays because the current slice has no predefined capacity.
- Capture a Go CPU profile and inspect the hot spots for append and runtime.growslice.
Expected behavior
- Provide a way to preallocate slice capacity (or otherwise reduce allocations) so that calls to runtime.growslice are minimized or eliminated.
Code example
- The current column type does not allow setting the initial capacity of the slice:
type ColDateTime64 struct {
Data []DateTime64
Location *time.Location
Precision Precision
PrecisionSet bool
}
Describe the bug
Appendbuilt-in uses excessive CPU due to frequent runtime.growslice calls.Steps to reproduce
Expected behavior
Code example