@@ -331,10 +331,16 @@ Summary
331331git clone https://github.com/yourusername/zig-bench.git
332332cd zig-bench
333333
334- # Run tests
334+ # Run all tests (unit + integration)
335335zig build test
336336
337- # Build examples
337+ # Run only unit tests
338+ zig build test-unit
339+
340+ # Run only integration tests
341+ zig build test-integration
342+
343+ # Build all examples
338344zig build examples
339345
340346# Run specific example
@@ -359,9 +365,9 @@ Inspired by [mitata](https://github.com/evanwashere/mitata), a beautiful JavaScr
359365
360366## Advanced Features
361367
362- All advanced features are now implemented and available! See the ` examples/advanced_features.zig ` for a complete demonstration.
368+ Zig Bench now includes a comprehensive suite of advanced features for professional benchmarking!
363369
364- ### ✅ Implemented Features
370+ ### ✅ Core Advanced Features (Phase 1)
365371
366372- ** JSON/CSV Export** - Export benchmark results to JSON or CSV format
367373- ** Historical Comparison** - Compare current results against saved baselines with regression detection
@@ -372,6 +378,17 @@ All advanced features are now implemented and available! See the `examples/advan
372378- ** Custom Allocator Benchmarking** - Built-in support for benchmarking with different allocators
373379- ** Benchmark Filtering** - Run specific benchmarks by name pattern
374380
381+ ### 🚀 Advanced Features (Phase 2)
382+
383+ - ** Benchmark Groups/Categories** - Organize benchmarks into logical groups
384+ - ** Automatic Warmup Detection** - Intelligently determine optimal warmup iterations
385+ - ** Statistical Outlier Detection** - Remove anomalies using IQR, Z-score, or MAD methods
386+ - ** Parameterized Benchmarks** - Run benchmarks with different input parameters
387+ - ** Multi-threaded Benchmarks** - Test parallel performance and scalability
388+ - ** GitHub Actions Workflow** - Ready-to-use CI/CD workflow template
389+ - ** GitLab CI Template** - Complete GitLab CI/CD configuration
390+ - ** Web Dashboard** - Interactive HTML dashboard for visualizing results
391+
375392### Export Results to JSON/CSV
376393
377394``` zig
@@ -522,3 +539,158 @@ Measurements use Zig's high-resolution timer which typically has nanosecond prec
522539- Background processes
523540
524541Run multiple times and look for consistency in results.
542+
543+ ## Phase 2 Advanced Features
544+
545+ ### Benchmark Groups
546+
547+ Organize related benchmarks into categories for better organization:
548+
549+ ``` zig
550+ const groups = @import("groups");
551+
552+ var manager = groups.GroupManager.init(allocator);
553+ defer manager.deinit();
554+
555+ // Create groups
556+ var algorithms = try manager.addGroup("Algorithms");
557+ try algorithms.add("QuickSort", quicksortBench);
558+ try algorithms.add("MergeSort", mergesortBench);
559+
560+ var io = try manager.addGroup("I/O Operations");
561+ try io.add("File Read", fileReadBench);
562+ try io.add("File Write", fileWriteBench);
563+
564+ // Run all groups
565+ try manager.runAll();
566+
567+ // Or run specific group
568+ try manager.runGroup("Algorithms");
569+ ```
570+
571+ ### Automatic Warmup Detection
572+
573+ Let the framework automatically determine optimal warmup iterations:
574+
575+ ``` zig
576+ const warmup = @import("warmup");
577+
578+ const detector = warmup.WarmupDetector.initDefault();
579+ const result = try detector.detect(myBenchFunc, allocator);
580+
581+ std.debug.print("Optimal warmup: {d} iterations\n", .{result.optimal_iterations});
582+ std.debug.print("Stabilized: {}\n", .{result.stabilized});
583+ std.debug.print("CV: {d:.4}\n", .{result.final_cv});
584+ ```
585+
586+ ### Outlier Detection and Removal
587+
588+ Clean benchmark data by removing statistical outliers:
589+
590+ ``` zig
591+ const outliers = @import("outliers");
592+
593+ // Configure outlier detection
594+ const config = outliers.OutlierConfig{
595+ .method = .iqr, // or .zscore, .mad
596+ .iqr_multiplier = 1.5,
597+ };
598+
599+ const detector = outliers.OutlierDetector.init(config);
600+ var result = try detector.detectAndRemove(samples, allocator);
601+ defer result.deinit();
602+
603+ std.debug.print("Removed {d} outliers ({d:.2}%)\n", .{
604+ result.outlier_count,
605+ result.outlier_percentage,
606+ });
607+ ```
608+
609+ ### Parameterized Benchmarks
610+
611+ Test performance across different input sizes:
612+
613+ ``` zig
614+ const param = @import("parameterized");
615+
616+ // Define sizes to test
617+ const sizes = [_]usize{ 10, 100, 1000, 10000 };
618+
619+ // Create parameterized benchmark
620+ var suite = try param.sizeParameterized(
621+ allocator,
622+ "Array Sort",
623+ arraySortBench,
624+ &sizes,
625+ );
626+ defer suite.deinit();
627+
628+ try suite.run();
629+ ```
630+
631+ ### Multi-threaded Benchmarks
632+
633+ Measure parallel performance and scalability:
634+
635+ ``` zig
636+ const parallel = @import("parallel");
637+
638+ // Single parallel benchmark
639+ const config = parallel.ParallelConfig{
640+ .thread_count = 4,
641+ .iterations_per_thread = 1000,
642+ };
643+
644+ const pb = parallel.ParallelBenchmark.init(allocator, "Parallel Op", func, config);
645+ var result = try pb.run();
646+ defer result.deinit();
647+
648+ try parallel.ParallelBenchmark.printResult(&result);
649+
650+ // Scalability test across thread counts
651+ const thread_counts = [_]usize{ 1, 2, 4, 8 };
652+ const scalability = parallel.ScalabilityTest.init(
653+ allocator,
654+ "Scalability",
655+ func,
656+ &thread_counts,
657+ 1000,
658+ );
659+ try scalability.run();
660+ ```
661+
662+ ### CI/CD Integration
663+
664+ #### GitHub Actions
665+
666+ Copy ` .github/workflows/benchmarks.yml ` to your repository for automatic benchmarking on every push/PR:
667+
668+ - Runs benchmarks on multiple platforms
669+ - Compares against baseline
670+ - Posts results as PR comments
671+ - Uploads artifacts
672+
673+ #### GitLab CI
674+
675+ Copy ` .gitlab-ci.yml ` to your repository for GitLab CI integration:
676+
677+ - Multi-stage pipeline (build, test, benchmark, report)
678+ - Automatic baseline comparison
679+ - GitLab Pages dashboard generation
680+ - Regression detection
681+
682+ ### Web Dashboard
683+
684+ Open ` web/dashboard.html ` in a browser to visualize benchmark results:
685+
686+ - Interactive charts and graphs
687+ - Load results from JSON files or URLs
688+ - Compare multiple benchmark runs
689+ - Export/share visualizations
690+
691+ To use:
692+ 1 . Run benchmarks and generate ` benchmark_results.json `
693+ 2 . Open ` web/dashboard.html ` in a browser
694+ 3 . Load the JSON file or use demo data
695+ 4 . Explore interactive visualizations
696+
0 commit comments