Skip to content

Conversation

@morrisonlevi
Copy link
Collaborator

@morrisonlevi morrisonlevi commented Jan 29, 2026

Description

Replaces once_cell types with ones in the std library (since 1.70). In one case it removes a Lazy instead and handles the non-const parts by writing them in get_module. Note that OnceCell in the stdlib isn't Sync so once_cell::sync::OnceCell was replaced by std::sync::OnceLock in most cases.

My real motivation is to use PHP globals for some things instead of Rust TLS variables. They have been problematic in the memory allocation profiler because of ext/grpc doing unsafe (and wrong, not just unsafe) things. While exploring that, I noticed this cleanup was possible. It's only net new lines of code because there are new comments.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@morrisonlevi morrisonlevi requested review from a team as code owners January 29, 2026 05:01
@morrisonlevi morrisonlevi added the profiling Relates to the Continuous Profiler label Jan 29, 2026
Since Rust 1.70 there are types in core we can use, or in some cases
we can avoid the type and rely on get_module as a place to run the
bits that are non-const.
@morrisonlevi morrisonlevi force-pushed the levi/const-module-entry branch from 1cc1ebc to cefbc5b Compare January 29, 2026 05:02
@datadog-official
Copy link

datadog-official bot commented Jan 29, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 27 Tests failed

testSearchPhpBinaries from integration.DDTrace\Tests\Integration\PHPInstallerTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integration\PHPInstallerTest::testSearchPhpBinaries
Test code or tested code printed unexpected output: Searching for available php binaries, this operation might take a while.

phpvfscomposer://tests/vendor/phpunit/phpunit/phpunit:106

    testSimplePushAndProcess from laravel-58-test.DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest (Fix with Cursor)

testSimplePushAndProcess from laravel-8x-test.DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest::testSimplePushAndProcess
Test code or tested code printed unexpected output: spanLinksTraceId: 697b89c200000000fd1d921b94e892c3
tid: 697b89c200000000
hexProcessTraceId: fd1d921b94e892c3
hexProcessSpanId: b75f2dc7a9cb26a4
processTraceId: 18238894713080419011
processSpanId: 13213330167298729636
View all

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8198125 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.20%. Comparing base (21d2f00) to head (8198125).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3607      +/-   ##
==========================================
- Coverage   62.24%   62.20%   -0.05%     
==========================================
  Files         141      141              
  Lines       13387    13387              
  Branches     1753     1753              
==========================================
- Hits         8333     8327       -6     
- Misses       4257     4263       +6     
  Partials      797      797              

see 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 21d2f00...8198125. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter
Copy link

pr-commenter bot commented Jan 29, 2026

Benchmarks [ profiler ]

Benchmark execution time: 2026-01-29 16:27:42

Comparing candidate commit 8198125 in PR branch levi/const-module-entry with baseline commit 21d2f00 in branch master.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 27 metrics, 7 unstable metrics.

scenario:php-profiler-timeline-memory-with-profiler-and-timeline

  • 🟥 cpu_user_time [+42.459ms; +90.538ms] or [+2.750%; +5.864%]
  • 🟥 execution_time [+49.321ms; +59.317ms] or [+4.045%; +4.864%]

@morrisonlevi morrisonlevi merged commit ff8f987 into master Jan 29, 2026
1667 of 1747 checks passed
@morrisonlevi morrisonlevi deleted the levi/const-module-entry branch January 29, 2026 16:28
@github-actions github-actions bot added this to the 1.17.0 milestone Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Relates to the Continuous Profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants