Documentation
¶
Overview ¶
Package mmap provides memory-mapped file I/O for zero-copy high-performance reading
Index ¶
Constants ¶
View Source
const ( // Memory protection flags PROT_READ = syscall.PROT_READ // Memory mapping flags MAP_SHARED = syscall.MAP_SHARED // Memory advice flags MADV_SEQUENTIAL = syscall.MADV_SEQUENTIAL MADV_WILLNEED = syscall.MADV_WILLNEED )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LineReader ¶
type LineReader struct {
// contains filtered or unexported fields
}
LineReader provides line-oriented reading over memory-mapped data
func NewLineReader ¶
func NewLineReader(filename string, batchSize int) (*LineReader, error)
NewLineReader creates a new line reader over memory-mapped file
func (*LineReader) ReadBatch ¶
func (lr *LineReader) ReadBatch() ([][]byte, error)
ReadBatch reads a batch of lines
type ParallelCSVReader ¶
type ParallelCSVReader struct {
// contains filtered or unexported fields
}
ParallelCSVReader reads CSV files using memory mapping and parallel processing
func NewParallelCSVReader ¶
func NewParallelCSVReader(filename string, delimiter byte, numWorkers int) (*ParallelCSVReader, error)
NewParallelCSVReader creates a new parallel CSV reader
func (*ParallelCSVReader) Close ¶
func (pcr *ParallelCSVReader) Close() error
Close closes the parallel CSV reader
func (*ParallelCSVReader) GetReader ¶
func (pcr *ParallelCSVReader) GetReader() *LineReader
GetReader returns the underlying LineReader
func (*ParallelCSVReader) ReadAll ¶
func (pcr *ParallelCSVReader) ReadAll() ([][]string, error)
ReadAll reads all CSV records in parallel
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader provides memory-mapped file reading with zero-copy performance
func (*Reader) ProcessParallel ¶
ProcessParallel processes the file in parallel chunks
Click to show internal directories.
Click to hide internal directories.