# 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`. - Follow-up metrics and final verification are recorded in `docs/perf/2026-02-18-after.md`.