Skip to content

Convert ThreadHelper.actor.h to standard coroutines#13374

Open
tclinkenbeard-oai wants to merge 3 commits into
apple:mainfrom
tclinkenbeard-oai:dev/tclinkenbeard/thread-helper-coroutines
Open

Convert ThreadHelper.actor.h to standard coroutines#13374
tclinkenbeard-oai wants to merge 3 commits into
apple:mainfrom
tclinkenbeard-oai:dev/tclinkenbeard/thread-helper-coroutines

Conversation

@tclinkenbeard-oai

Copy link
Copy Markdown
Collaborator

This PR converts ThreadHelper.actor.h to standard C++ coroutines and renames it to ThreadHelper.h.

To avoid performance regression, coro::DetachedCoroutine is added for onMainThreadVoid. It provides a fire-and-forget coroutine whose frame owns and destroys itself. This avoids allocating a result Future/SAV and omits cancellation bookkeeping because callers receive no handle.

Performance compared to actor implementation, using #13358 (negative is faster):

Batch Plain enqueue Error-member
1 -1.8% +0.3%
4 +12.3% +3.1%
16 -18.2% -1.8%
64 -12.5% +0.4%
256 -9.9% +4.1%
1024 -13.0% +3.9%*

The detached implementation reduces the initial error-member regression from 20–24% to within approximately 4%. Its coroutine frame also drops from the 128-byte to 96-byte allocation bucket.

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests on Linux RHEL 9

  • Commit ID: 347586c
  • Duration 0:10:15
  • Result: ❌ FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 347586c
  • Duration 0:10:35
  • Result: ❌ FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-ide on Linux RHEL 9

  • Commit ID: 347586c
  • Duration 0:19:17
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: 347586c
  • Duration 0:32:36
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-arm on Linux RHEL 9

  • Commit ID: 347586c
  • Duration 0:45:37
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: 347586c
  • Duration 0:47:56
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 347586c
  • Duration 0:54:59
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

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