Skip to content

Commit 949a3f3

Browse files
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 ops
1 parent a87b32a commit 949a3f3

File tree

3 files changed

+286
-297
lines changed

3 files changed

+286
-297
lines changed

Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ let package = Package(
4141
),
4242
.testTarget(
4343
name: "IEEE_754".tests,
44-
dependencies: ["IEEE_754"]
44+
dependencies: [
45+
"IEEE_754",
46+
.product(name: "StandardsTestSupport", package: "swift-standards")
47+
]
4548
)
4649
],
4750
swiftLanguageModes: [.v6]

0 commit comments

Comments
 (0)