sim

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortResults

func SortResults(results []Result)

Types

type Config

type Config struct {
	Mode                          Mode
	MaxCacheBytes                 int64
	MinEventsBeforePrefetch       int
	MaxPredictionsPerEvent        int
	PredictionConfidenceThreshold float64
	BindingConfidenceThreshold    float64
	BindingMinTrials              int
	StructuralMinSimilarity       float64
	StructuralColdStartPenalty    float64
	StructuralPrefetchConfidence  float64
	MaxStructuralNeighbors        int
	MaxStructuralTemplates        int
	MaxStructuralFeatures         int
}

func DefaultConfig

func DefaultConfig(mode Mode) Config

type Mode

type Mode string
const (
	ModeNoCache              Mode = "no_cache"
	ModeExactCache           Mode = "exact_cache"
	ModePredictive           Mode = "predictive"
	ModePredictiveStructural Mode = "predictive_structural"
)

type Result

type Result struct {
	Mode                          Mode
	Events                        int
	Selects                       int
	Writes                        int
	CacheHits                     int
	CacheMisses                   int
	PrefetchAttempts              int
	PrefetchHits                  int
	PrefetchWasted                int
	PrefetchRejected              int
	PredictionAttempts            int
	PredictionAccepted            int
	EstimatedDBLatency            time.Duration
	EstimatedCacheLatency         time.Duration
	EstimatedLatencySaved         time.Duration
	CacheEntries                  int
	CacheBytes                    int64
	ContextsObserved              int
	BindingRulesLearned           int
	PredictionAccuracyAt1         float64
	PredictionAccuracyAt3         float64
	CacheHitRate                  float64
	PrefetchHitRate               float64
	PrefetchWasteRate             float64
	MemoryBytes                   int64
	CacheHitRateLiftVsBase        float64
	StructuralFallbackAccepted    int
	StructuralFallbackEvaluated   int
	StructuralFallbackAccuracyAt1 float64
	StructuralTemplates           int
}

func Compare

func Compare(w workload.Workload, cfg Config) ([]Result, error)

func Run

func Run(w workload.Workload, cfg Config) (Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL