How do you run performance tests on Swift packages in Xcode?

I've been trying to run a performance test on a Swift package in Xcode for about an hour now, but I can't seem to get the "No baseline average for Time" message to go away. I've updated the baseline value through Xcode's UI multiple times and it just doesn't seem to stick. Is this issue unique to Swift packages or just a more general bug in Xcode?

Thanks!

The strange thing is that I can confirm setting a baseline average in Xcode adds the following two files to the Swift package:

.swiftpm/xcode/xcshareddata/xcbaselines/{Package Name}.xcbaseline/{UUID}.plist
.swiftpm/xcode/xcshareddata/xcbaselines/{Package Name}.xcbaseline/Info.plist

The former looks something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>classNames</key>
        <dict>
                <key>PackageTests</key>
                <dict>
                        <key>testPerformance()</key>
                        <dict>
                                <key>com.apple.XCTPerformanceMetric_WallClockTime</key>
                                <dict>
                                        <key>baselineAverage</key>
                                        <real>0.00903</real>
                                        <key>baselineIntegrationDisplayName</key>
                                        <string>Local Baseline</string>
                                </dict>
                        </dict>
                </dict>
        </dict>
</dict>
</plist>

And here's Info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>runDestinationsByUUID</key>
        <dict>
                <key>D36CD09E-8356-41EE-9A77-1F6891B15F09</key>
                <dict>
                        <key>localComputer</key>
                        <dict>
                                <key>busSpeedInMHz</key>
                                <integer>…</integer>
                                <key>cpuCount</key>
                                <integer>…</integer>
                                <key>cpuKind</key>
                                <string>…</string>
                                <key>cpuSpeedInMHz</key>
                                <integer>…</integer>
                                <key>logicalCPUCoresPerPackage</key>
                                <integer>…</integer>
                                <key>modelCode</key>
                                <string>…</string>
                                <key>physicalCPUCoresPerPackage</key>
                                <integer>…</integer>
                                <key>platformIdentifier</key>
                                <string>com.apple.platform.macosx</string>
                        </dict>
                        <key>targetArchitecture</key>
                        <string>x86_64</string>
                </dict>
        </dict>
</dict>
</plist>

Even though Xcode automatically created these files for me, it doesn't appear to realize that it did:

No baseline average for Time

Is this a known issue with how Xcode handles performance tests for Swift packages or am I just misunderstanding how they're supposed to work?

I still can't seem to get this to work. Just out of curiosity, how does everyone else run performance tests on Swift packages?

FWIW I'm having the same issue on Xcode 12.3

1 Like

Thanks for confirming—I'm glad to know I'm not the only one! (For the record, I last tested this on Xcode 12.4.)

1 Like

Same behaviour with Xcode 13 beta 2.

Terms of Service

Privacy Policy

Cookie Policy