Documentation
¶
Index ¶
- func AlignedAlloc(size int, alignment int) []float64
- func OptimizeDataLayout(data []float64, rows, cols int) []float64
- type ChunkedProcessor
- type CompressionType
- type DataType
- type GCOptimizer
- type MatrixPool
- type MemoryEfficientBatch
- type MemoryMappedDataset
- func (m *MemoryMappedDataset) Close() error
- func (m *MemoryMappedDataset) GetChunk(startRow, endRow int) (mat.Matrix, error)
- func (m *MemoryMappedDataset) IterateChunks(chunkSize int, fn func(chunk mat.Matrix, startRow int) error) error
- func (m *MemoryMappedDataset) SetChunk(startRow int, chunk mat.Matrix) error
- type PoolStats
- type PooledMatrix
- type StreamMetrics
- type StreamStage
- type StreamingPipeline
- type ZeroCopyMatrix
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignedAlloc ¶
AlignedAlloc allocates aligned memory for SIMD operations
func OptimizeDataLayout ¶
OptimizeDataLayout optimizes data layout for cache efficiency
Types ¶
type ChunkedProcessor ¶
type ChunkedProcessor struct {
// contains filtered or unexported fields
}
ChunkedProcessor processes data in chunks with parallel execution
func NewChunkedProcessor ¶
func NewChunkedProcessor(chunkSize int, parallel bool) *ChunkedProcessor
NewChunkedProcessor creates a new chunked processor
type CompressionType ¶
type CompressionType int
CompressionType defines compression algorithms
const ( NoCompression CompressionType = iota GzipCompression SnappyCompression LZ4Compression )
type GCOptimizer ¶
type GCOptimizer struct {
// contains filtered or unexported fields
}
GCOptimizer manages garbage collection for better performance
func NewGCOptimizer ¶
func NewGCOptimizer(gcPercent int, maxPause time.Duration) *GCOptimizer
NewGCOptimizer creates a new GC optimizer
func (*GCOptimizer) ForceGC ¶
func (g *GCOptimizer) ForceGC()
ForceGC forces a garbage collection if needed
func (*GCOptimizer) GetStats ¶
func (g *GCOptimizer) GetStats() map[string]interface{}
GetStats returns GC optimization statistics
type MatrixPool ¶
type MatrixPool struct {
// contains filtered or unexported fields
}
MatrixPool provides object pooling for matrices to reduce GC pressure
func NewMatrixPool ¶
func NewMatrixPool(maxSize int) *MatrixPool
NewMatrixPool creates a new matrix pool
func (*MatrixPool) Get ¶
func (mp *MatrixPool) Get(rows, cols int) *PooledMatrix
Get retrieves a matrix from the pool
func (*MatrixPool) GetStats ¶
func (mp *MatrixPool) GetStats() PoolStats
GetStats returns current pool statistics
func (*MatrixPool) Put ¶
func (mp *MatrixPool) Put(m *PooledMatrix)
Put returns a matrix to the pool
type MemoryEfficientBatch ¶
type MemoryEfficientBatch struct {
// contains filtered or unexported fields
}
MemoryEfficientBatch processes data in memory-efficient batches
func NewMemoryEfficientBatch ¶
func NewMemoryEfficientBatch(maxMemoryMB int64) *MemoryEfficientBatch
NewMemoryEfficientBatch creates a memory-efficient batch processor
func (*MemoryEfficientBatch) Allocate ¶
func (m *MemoryEfficientBatch) Allocate(bytes int64) error
Allocate tracks memory allocation
func (*MemoryEfficientBatch) CanAllocate ¶
func (m *MemoryEfficientBatch) CanAllocate(bytes int64) bool
CanAllocate checks if allocation is possible within memory limits
func (*MemoryEfficientBatch) Free ¶
func (m *MemoryEfficientBatch) Free(bytes int64)
Free tracks memory deallocation
func (*MemoryEfficientBatch) GetUsage ¶
func (m *MemoryEfficientBatch) GetUsage() (used, max int64)
GetUsage returns current memory usage
type MemoryMappedDataset ¶
type MemoryMappedDataset struct {
// contains filtered or unexported fields
}
MemoryMappedDataset provides memory-mapped file access for large datasets
func NewMemoryMappedDataset ¶
func NewMemoryMappedDataset(filename string, rows, cols int, dtype DataType) (*MemoryMappedDataset, error)
NewMemoryMappedDataset creates a new memory-mapped dataset
func (*MemoryMappedDataset) Close ¶
func (m *MemoryMappedDataset) Close() error
Close unmaps and closes the dataset
func (*MemoryMappedDataset) GetChunk ¶
func (m *MemoryMappedDataset) GetChunk(startRow, endRow int) (mat.Matrix, error)
GetChunk retrieves a chunk of data without loading entire dataset
func (*MemoryMappedDataset) IterateChunks ¶
func (m *MemoryMappedDataset) IterateChunks(chunkSize int, fn func(chunk mat.Matrix, startRow int) error) error
IterateChunks provides iterator over dataset chunks
type PoolStats ¶
type PoolStats struct {
TotalAllocated int64
TotalRecycled int64
CurrentInUse int64
PeakUsage int64
AverageReuseRate float64
}
PoolStats tracks pool performance metrics
type PooledMatrix ¶
type PooledMatrix struct {
// contains filtered or unexported fields
}
PooledMatrix is a matrix that can be returned to a pool
func (*PooledMatrix) At ¶
func (m *PooledMatrix) At(i, j int) float64
At returns the value at (i, j)
func (*PooledMatrix) Release ¶
func (m *PooledMatrix) Release()
Release returns the matrix to the pool
func (*PooledMatrix) Set ¶
func (m *PooledMatrix) Set(i, j int, v float64)
Set sets the value at (i, j)
func (*PooledMatrix) ToMat ¶
func (m *PooledMatrix) ToMat() mat.Matrix
ToMat converts to a gonum matrix
type StreamMetrics ¶
type StreamMetrics struct {
ProcessedSamples uint64
ProcessedBytes uint64
Throughput float64
Latency float64
// contains filtered or unexported fields
}
StreamMetrics tracks streaming performance metrics
type StreamStage ¶
StreamStage represents a processing stage in the pipeline
type StreamingPipeline ¶
type StreamingPipeline struct {
// contains filtered or unexported fields
}
StreamingPipeline provides efficient streaming data processing
func NewStreamingPipeline ¶
func NewStreamingPipeline(bufferSize int) *StreamingPipeline
NewStreamingPipeline creates a new streaming pipeline
func (*StreamingPipeline) AddStage ¶
func (s *StreamingPipeline) AddStage(stage StreamStage)
AddStage adds a processing stage to the pipeline
func (*StreamingPipeline) GetMetrics ¶
func (s *StreamingPipeline) GetMetrics() StreamMetrics
GetMetrics returns current pipeline metrics
type ZeroCopyMatrix ¶
type ZeroCopyMatrix struct {
// contains filtered or unexported fields
}
ZeroCopyMatrix provides zero-copy matrix operations
func NewZeroCopyMatrix ¶
func NewZeroCopyMatrix(data []float64, rows, cols int) *ZeroCopyMatrix
NewZeroCopyMatrix creates a zero-copy matrix from existing data
func (*ZeroCopyMatrix) At ¶
func (m *ZeroCopyMatrix) At(i, j int) float64
At returns the value at (i, j) with bounds checking
func (*ZeroCopyMatrix) Dims ¶
func (m *ZeroCopyMatrix) Dims() (int, int)
Dims returns the dimensions
func (*ZeroCopyMatrix) Set ¶
func (m *ZeroCopyMatrix) Set(i, j int, v float64)
Set sets the value at (i, j) with bounds checking
func (*ZeroCopyMatrix) Slice ¶
func (m *ZeroCopyMatrix) Slice(i0, i1, j0, j1 int) *ZeroCopyMatrix
Slice creates a view of a submatrix without copying