Skip to content

inEventLoop benchmark#3301

Merged
weissi merged 1 commit intoapple:mainfrom
weissi:jw-in-el-bench
Jul 14, 2025
Merged

inEventLoop benchmark#3301
weissi merged 1 commit intoapple:mainfrom
weissi:jw-in-el-bench

Conversation

@weissi
Copy link
Copy Markdown
Member

@weissi weissi commented Jul 14, 2025

Motivation:

PR #3297 is changing inEventLoop and inEventLoop is very much on the perf path. So let's add a benchmark

Modifications:

  • Add (!)inEventLoop benchmark
  • Fix a guaranteed deadlock in TCPThroughputBenchmark to make the benchmarks runnable

Result:

  • More benchmarks
  • Fewer hangs

@weissi weissi requested a review from Lukasa July 14, 2025 10:27
@weissi weissi added the semver/none No version bump required. label Jul 14, 2025
@weissi weissi enabled auto-merge (squash) July 14, 2025 10:28
return try! EventLoopFuture<Int>.reduce(into: 0, futures, on: el1, { $0 += $1 }).wait()
}

try measureAndPrint(desc: "el_in_eventloop_100M") {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's about 0.2s in release mode on my machine, should be alright

@weissi weissi merged commit 57d65dd into apple:main Jul 14, 2025
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants