Documentation
¶
Overview ¶
Package fastops CPU feature detection. Currently all detection functions return false — no actual SIMD intrinsics are used. This is scaffolding for future platform-specific assembly (.s files with AVX2/NEON instructions).
Package fastops provides performance-optimized string operations using manual loop unrolling (processing 16 bytes per iteration). These are manually unrolled scalar loops that improve performance by reducing branch overhead and enabling better CPU pipelining. The Go compiler may auto-vectorize some patterns, but correctness does not depend on hardware SIMD support.
NOTE: Despite historical naming, this package contains NO actual SIMD intrinsics (no AVX2, AVX-512, or NEON assembly). All functions are pure Go scalar implementations with manual loop unrolling. The Dispatcher and CPU feature detection exist as scaffolding for future platform-specific assembly.
Index ¶
- func ContainsAny(s string, substrs []string) bool
- func ContainsWord(s, word string) bool
- func FastContains(s, substr string) bool
- func FastCountBytes(data string, target byte) int
- func FastEqual(a, b string) bool
- func FastHasANSI(data string) bool
- func FastLower(s string) string
- func HasANSI(data string) bool
- func IsWordChar(c byte) bool
- func Process(data string) string
- func SplitWords(input string) []string
- func StripANSI(input string) string
- type CPUFeatures
- type Dispatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsAny ¶
ContainsAny checks if string contains any of the substrings
func ContainsWord ¶
ContainsWord checks if string contains word (space-delimited)
func FastContains ¶
FastContains checks if string contains substring (optimized for small patterns)
func FastCountBytes ¶
FastCountBytes counts bytes using unrolled scalar loop
func FastHasANSI ¶
FastHasANSI checks for ANSI sequences using unrolled scalar loop
func SplitWords ¶
SplitWords splits string into words (optimized)
Types ¶
type CPUFeatures ¶
CPUFeatures holds detected CPU capabilities. Currently all fields are always false — no real SIMD detection is implemented.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher selects optimal implementation. Currently always dispatches to scalar — no real SIMD paths exist. The dispatch structure is scaffolding for future platform-specific assembly.
func NewDispatcher ¶
func NewDispatcher() *Dispatcher
NewDispatcher creates dispatcher (currently always scalar).
func (*Dispatcher) EntropyFilter ¶
func (d *Dispatcher) EntropyFilter(data []float64) float64
EntropyFilter dispatches to scalar implementation. TODO: Add real AVX2/NEON assembly in entropy_amd64.s / entropy_arm64.s