Performance Tuning
Benchmarking
Copy
# Benchmark current configuration
results <- benchmark_qiprng(
sample_sizes = c(1000, 10000, 100000),
distributions = c("uniform", "normal", "exponential")
)
print(results$summary)
Hardware Acceleration
SIMD Vectorization
Copy
# Check SIMD availability
config <- default_config()
print(config$simd_available)
# SIMD is automatically used when available
createPRNG(list(use_simd = TRUE))
Cache Optimization
Copy
# Enable caching for repeated operations
set_cache_enabled(TRUE)
set_cache_ttl(3600) # 1 hour TTL
# Pre-generate and cache
init_cache()
Memory Management
Copy
# Configure buffer sizes
createPRNG(list(
buffer_size = 8192, # Larger buffer for batch generation
cache_size = 1048576 # 1MB cache
))
Profiling
Copy
# Profile configuration
profile <- profile_qiprng_config(
config = default_config(),
operations = c("generate", "jump", "reseed"),
iterations = 1000
)
# Identify bottlenecks
print(profile$bottlenecks)