Skip to content

Add Kotlin script for running benchmarks on iOS#5563

Merged
pjBooms merged 10 commits intomasterfrom
pjBooms/run-ios-benchmarks-script
Mar 26, 2026
Merged

Add Kotlin script for running benchmarks on iOS#5563
pjBooms merged 10 commits intomasterfrom
pjBooms/run-ios-benchmarks-script

Conversation

@pjBooms
Copy link
Copy Markdown
Contributor

@pjBooms pjBooms commented Mar 24, 2026

Add run_ios_benchmarks.main.kts script for running benchmarks on iOS:

  • all modes are supported
  • JSon saving supported
  • can run benchmarks either in a separate process or within one process
  • Used now in compare_benchmarks.main.kts for iOS target

Release Notes

N/A

@pjBooms pjBooms requested a review from ASalavei March 24, 2026 11:46
*/
expect fun saveBenchmarkStats(name: String, stats: BenchmarkStats)

expect val isIosTarget: Boolean
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's a good variable name for the common code. Could you please elaborate why we need to print stats only for iOS platform?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Desktop/macos store stats on disk directly. Web sends stats via server.
For iOS we can't store stats on disk, because the disk is the device disk that is write protected. The easiest way is to send it to console and parse on the running host side (from the script). This way we uninfy interface with other platforms.

Not sure it's a good variable name for the common code

We may introduce target instead, but currently only iOS specific logic is required.


fun runReal() = Config.isModeEnabled(Mode.REAL)

fun runBenchmarks() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add this option to prevent screen from dimming:

Suggested change
fun runBenchmarks() {
UIApplication.sharedApplication.setIdleTimerDisabled(true)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@pjBooms pjBooms requested a review from ASalavei March 26, 2026 13:52
@pjBooms pjBooms merged commit ed489b5 into master Mar 26, 2026
4 checks passed
@pjBooms pjBooms deleted the pjBooms/run-ios-benchmarks-script branch March 26, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants