diff options
| author | Fuwn <[email protected]> | 2026-02-18 11:41:58 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-18 11:42:11 -0800 |
| commit | dd690e6be3bba1f0d3aa6e853e50e23cf44f75ec (patch) | |
| tree | 146ec3964c02579f63465c88199fcc8270d0c4e1 /docs/perf | |
| parent | Fix SwiftLint violations (diff) | |
| download | sora-testing-dd690e6be3bba1f0d3aa6e853e50e23cf44f75ec.tar.xz sora-testing-dd690e6be3bba1f0d3aa6e853e50e23cf44f75ec.zip | |
test: add baseline test harness and performance baseline report
Diffstat (limited to 'docs/perf')
| -rw-r--r-- | docs/perf/2026-02-18-baseline.md | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/docs/perf/2026-02-18-baseline.md b/docs/perf/2026-02-18-baseline.md new file mode 100644 index 0000000..9240ad6 --- /dev/null +++ b/docs/perf/2026-02-18-baseline.md @@ -0,0 +1,92 @@ +# 2026-02-18 Baseline Metrics + +## Scope +- Task 1 baseline for performance/redundancy plan. +- Added `SoraTests` harness and failing baseline assertions. + +## Commands Run + +### Project generation +```bash +just generate +``` +Result: success (`Sora.xcodeproj` regenerated with `SoraTests` target). + +### Baseline tests via app scheme +```bash +xcodebuild -project Sora.xcodeproj -scheme Sora -destination 'platform=iOS Simulator,name=iPhone 17 Pro' test +``` +Result: failed before executing assertions because the simulator failed to initialise the test bundle host in the app scheme. + +### Baseline tests via test scheme (expected fail) +```bash +xcodebuild -project Sora.xcodeproj -scheme SoraTests -destination 'platform=iOS Simulator,name=iPhone 17 Pro' test +``` +Result: failed as expected baseline, with 4 failures in 3 tests. + +Failure highlights: +- `SettingsManagerSyncTests.testBatchedSyncPathGuardsUnchangedPayloadWrites` + - `XCTAssertGreaterThanOrEqual failed: ("0") is less than ("4")` +- `ViewDerivedDataTests.testGenericListViewDerivedCollectionsAreReferencedOncePerRenderPass` + - `filteredItems` references: `3 > 1` + - `sortedFilteredItems` references: `3 > 1` +- `ViewDerivedDataTests.testPostGridViewDerivedCollectionsAreReferencedOncePerRenderPass` + - `activePosts` references: `6 > 1` + +### Format + lint +```bash +just format && just lint +``` +Result: success. + +### Debug simulator build +```bash +just build_ios_simulator Debug +``` +Result: success. + +## Timing Snapshots + +### Test run (SoraTests scheme) +Command: +```bash +/usr/bin/time -p sh -c "xcodebuild -project Sora.xcodeproj -scheme SoraTests -destination 'platform=iOS Simulator,name=iPhone 17 Pro' test > /tmp/sora_task1_test.log 2>&1" +``` +Timing: +- real: `22.36s` +- user: `3.81s` +- sys: `2.91s` + +### Format + lint +Command: +```bash +/usr/bin/time -p sh -c "just format && just lint" +``` +Timing: +- real: `0.51s` +- user: `0.54s` +- sys: `0.11s` + +### Simulator debug build +Command: +```bash +/usr/bin/time -p just build_ios_simulator Debug +``` +Timing: +- real: `4.04s` +- user: `2.73s` +- sys: `1.43s` + +## Hotspot Files (Baseline) +- `Sora/Data/Settings/SettingsManager.swift` + - `triggerSyncIfNeeded(for:)` performs 4 `NSUbiquitousKeyValueStore.default.set(encoded, ...)` writes with no `!= encoded` unchanged guard in that batched sync path. +- `Sora/Views/Generic/GenericListView.swift` + - Repeated derived-data references in render path: + - `filteredItems`: 3 references + - `sortedFilteredItems`: 3 references +- `Sora/Views/Post/Grid/PostGridView.swift` + - `activePosts` referenced 6 times in the view/render path. + +## Notes +- Existing warning observed during build/test: + - `Sora.xcodeproj`: Copy Bundle Resources includes `Sora/Resources/Info.generated.plist`. |