Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tracing): remove atexit dead code and forksafe dead code #8573

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

ZStriker19
Copy link
Contributor

@ZStriker19 ZStriker19 commented Mar 1, 2024

In python 3.7 (what we support currently on main) hasattr(atexit, "unregister") is always true, so we don't need to check it. hasattr(os, "register_at_fork") is also ways true, so we don't need to check it.

Checklist

  • Change(s) are motivated and described in the PR description
  • Testing strategy is described if automated tests are not included in the PR
  • Risks are described (performance impact, potential for breakage, maintainability)
  • Change is maintainable (easy to change, telemetry, documentation)
  • Library release note guidelines are followed or label changelog/no-changelog is set
  • Documentation is included (in-code, generated user docs, public corp docs)
  • Backport labels are set (if applicable)
  • If this PR changes the public interface, I've notified @DataDog/apm-tees.
  • If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.

Reviewer Checklist

  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Description motivates each change
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Change is maintainable (easy to change, telemetry, documentation)
  • Release note makes sense to a user of the library
  • Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

@datadog-dd-trace-py-rkomorn
Copy link

Datadog Report

Branch report: zachg/clean_up_old_code_paths_for_exit_and_fork
Commit report: 98a8724
Test service: dd-trace-py

✅ 0 Failed, 170515 Passed, 1045 Skipped, 10m 32.39s Wall Time

@pr-commenter
Copy link

pr-commenter bot commented Mar 1, 2024

Benchmarks

Benchmark execution time: 2024-03-04 17:28:11

Comparing candidate commit 0934f71 in PR branch zachg/clean_up_old_code_paths_for_exit_and_fork with baseline commit 688074a in branch main.

Found 17 performance improvements and 14 performance regressions! Performance is the same for 172 metrics, 9 unstable metrics.

scenario:coreapiscenario-context_with_data_listeners

  • 🟩 max_rss_usage [-902.854KB; -737.184KB] or [-3.010%; -2.457%]

scenario:coreapiscenario-context_with_data_no_listeners

  • 🟩 max_rss_usage [-767.796KB; -606.412KB] or [-2.563%; -2.024%]

scenario:coreapiscenario-context_with_data_only_all_listeners

  • 🟥 max_rss_usage [+892.647KB; +1065.650KB] or [+3.084%; +3.681%]

scenario:coreapiscenario-core_dispatch_listeners

  • 🟩 max_rss_usage [-790.389KB; -605.938KB] or [-2.638%; -2.023%]

scenario:coreapiscenario-core_dispatch_listeners_and_all_listeners

  • 🟩 max_rss_usage [-1.126MB; -0.984MB] or [-3.750%; -3.276%]

scenario:coreapiscenario-core_dispatch_no_listeners

  • 🟩 max_rss_usage [-786.783KB; -636.577KB] or [-2.626%; -2.124%]

scenario:coreapiscenario-core_dispatch_only_all_listeners

  • 🟩 max_rss_usage [-800.463KB; -622.897KB] or [-2.673%; -2.080%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • 🟥 max_rss_usage [+0.946MB; +1.095MB] or [+3.268%; +3.785%]

scenario:coreapiscenario-core_dispatch_with_results_no_listeners

  • 🟩 max_rss_usage [-838.051KB; -669.686KB] or [-2.795%; -2.233%]

scenario:coreapiscenario-get_item_missing

  • 🟩 max_rss_usage [-854.039KB; -662.300KB] or [-2.848%; -2.209%]

scenario:coreapiscenario-set_item

  • 🟩 max_rss_usage [-784.924KB; -615.499KB] or [-2.619%; -2.054%]

scenario:httppropagationextract-all_styles_all_headers

  • 🟥 max_rss_usage [+664.492KB; +788.360KB] or [+2.265%; +2.688%]

scenario:httppropagationextract-b3_headers

  • 🟩 max_rss_usage [-1003.927KB; -904.809KB] or [-3.336%; -3.007%]

scenario:httppropagationextract-b3_single_headers

  • 🟥 max_rss_usage [+698.634KB; +811.970KB] or [+2.385%; +2.772%]

scenario:httppropagationextract-invalid_priority_header

  • 🟩 max_rss_usage [-802.971KB; -682.648KB] or [-2.669%; -2.269%]

scenario:httppropagationextract-tracecontext_headers

  • 🟩 max_rss_usage [-822.040KB; -714.779KB] or [-2.731%; -2.375%]

scenario:httppropagationextract-wsgi_empty_headers

  • 🟥 max_rss_usage [+638.132KB; +766.796KB] or [+2.174%; +2.612%]

scenario:httppropagationextract-wsgi_invalid_priority_header

  • 🟥 max_rss_usage [+660.348KB; +778.167KB] or [+2.254%; +2.656%]

scenario:httppropagationextract-wsgi_invalid_span_id_header

  • 🟥 max_rss_usage [+675.189KB; +771.928KB] or [+2.303%; +2.633%]

scenario:httppropagationextract-wsgi_large_header_no_matches

  • 🟩 max_rss_usage [-814.117KB; -723.521KB] or [-2.706%; -2.405%]

scenario:httppropagationextract-wsgi_medium_header_no_matches

  • 🟩 max_rss_usage [-788.102KB; -674.989KB] or [-2.621%; -2.244%]

scenario:httppropagationextract-wsgi_valid_headers_all

  • 🟥 max_rss_usage [+631.853KB; +740.717KB] or [+2.148%; +2.518%]

scenario:httppropagationinject-with_all

  • 🟩 max_rss_usage [-730.232KB; -659.541KB] or [-2.435%; -2.199%]

scenario:otelspan-start

  • 🟩 max_rss_usage [-5.074MB; -4.733MB] or [-10.142%; -9.461%]

scenario:samplingrules-average_match

  • 🟩 max_rss_usage [-720.509KB; -606.595KB] or [-2.403%; -2.023%]

scenario:sethttpmeta-no-collectipvariant

  • 🟥 max_rss_usage [+635.716KB; +746.684KB] or [+2.147%; +2.522%]

scenario:sethttpmeta-obfuscation-no-query

  • 🟥 max_rss_usage [+617.380KB; +725.699KB] or [+2.083%; +2.449%]

scenario:sethttpmeta-obfuscation-send-querystring-disabled

  • 🟥 max_rss_usage [+654.710KB; +765.373KB] or [+2.193%; +2.564%]

scenario:sethttpmeta-obfuscation-worst-case-implicit-query

  • 🟥 max_rss_usage [+673.783KB; +772.924KB] or [+2.257%; +2.589%]

scenario:sethttpmeta-useragentvariant_not_exists_1

  • 🟥 max_rss_usage [+731.269KB; +842.824KB] or [+2.472%; +2.849%]

scenario:span-add-metrics

  • 🟥 max_rss_usage [+25.779MB; +25.903MB] or [+65.962%; +66.281%]

@ZStriker19 ZStriker19 marked this pull request as ready for review March 1, 2024 20:18
@ZStriker19 ZStriker19 requested a review from a team as a code owner March 1, 2024 20:18
@ZStriker19 ZStriker19 added the changelog/no-changelog A changelog entry is not required for this PR. label Mar 1, 2024
@ZStriker19 ZStriker19 enabled auto-merge (squash) March 1, 2024 20:35
@ZStriker19 ZStriker19 merged commit 6592d5d into main Mar 4, 2024
156 checks passed
@ZStriker19 ZStriker19 deleted the zachg/clean_up_old_code_paths_for_exit_and_fork branch March 4, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants