Commit 949a3f3
committed
Add StandardsTestSupport and convert to proper performance testing
Package updates:
- Add StandardsTestSupport dependency for performance testing
- Create Tests/IEEE_754 Tests/Support/PerformanceTests.swift base suite
Converted Stress Tests to Performance Tests:
- All performance tests extend `Performance Tests` with .serialized execution
- Use @test(.timed(threshold: .milliseconds(...))) for accurate benchmarking
- Tests now report detailed metrics: Min, Median, Mean, p95, p99, Max, StdDev, Peak Memory
Performance test suites (27 tests):
1. Double - Performance (7 tests):
- Serialize 10K random doubles (100ms threshold)
- Round-trip 10K doubles (150ms threshold)
- Mixed special/normal values (200ms threshold)
- Rapid 1K conversions (50ms threshold)
- All API paths (100ms threshold)
- Alternating endianness (75ms threshold)
- Magnitude range sweep (200ms threshold)
2. Float - Performance (5 tests):
- Serialize 10K floats (75ms threshold)
- Round-trip 10K floats (100ms threshold)
- Rapid 1K conversions (40ms threshold)
- Alternating endianness (50ms threshold)
- Magnitude range sweep (100ms threshold)
3. Binary64/Binary32 - Performance (6 tests):
- Direct authoritative API benchmarks
- Serialization/deserialization at scale
- Both endianness performance
4. Bit Patterns - Performance (2 tests):
- All 256 byte values in each position
- Exhaustive pattern validation
5. Memory - Performance (4 tests):
- Memory leak detection with 10K iterations
- Serialization/deserialization efficiency
Kept separate (non-performance):
- Concurrent Access Consistency (2 async tests)
- Deterministic Behavior (3 tests)
Results: 174 tests in 55 suites, all passing
- Performance tests complete in 1.744 seconds
- All metrics well under thresholds
- Peak memory usage: ~2.75-2.81 KB per test
- 0 swiftlint violations
Performance highlights:
- Double serialization: ~3.75ms for 10K ops
- Float serialization: ~3.58ms for 10K ops
- Double deserialization: ~28.20ms for 10K ops
- Float deserialization: ~16.74ms for 10K ops1 parent a87b32a commit 949a3f3
File tree
3 files changed
+286
-297
lines changed- Tests/IEEE_754 Tests
- Support
3 files changed
+286
-297
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
0 commit comments