dd-trace-py icon indicating copy to clipboard operation
dd-trace-py copied to clipboard

chore(rc): avoid expires parsing

Open P403n1x87 opened this issue 5 months ago • 1 comments

We avoid parsing the expires string into a date-time object. Currently the value is not used, so we avoid calls to _strptime, which make use of a global lock in its internal implementation.

Checklist

  • [ ] PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • [ ] Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, 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

P403n1x87 avatar Jun 27 '25 15:06 P403n1x87

CODEOWNERS have been resolved as:

ddtrace/internal/remoteconfig/client.py                                 @DataDog/remote-config @DataDog/apm-core-python
ddtrace/internal/utils/time.py                                          @DataDog/apm-core-python

github-actions[bot] avatar Jun 27 '25 15:06 github-actions[bot]

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 275 ± 5 ms.

The average import time from base is: 277 ± 3 ms.

The import time difference between this PR and base is: -1.8 ± 0.2 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.961 ms (0.71%)
ddtrace.bootstrap.sitecustomize 1.291 ms (0.47%)
ddtrace.bootstrap.preload 1.291 ms (0.47%)
ddtrace.internal.remoteconfig.client 0.631 ms (0.23%)
ddtrace 0.670 ms (0.24%)
ddtrace.internal._unpatched 0.030 ms (0.01%)
json 0.030 ms (0.01%)
json.decoder 0.030 ms (0.01%)
re 0.030 ms (0.01%)
enum 0.030 ms (0.01%)
types 0.030 ms (0.01%)

github-actions[bot] avatar Jun 27 '25 15:06 github-actions[bot]

We should probably add a release note to this one for anyone that has encountered strange timeouts before

tylfin avatar Jun 27 '25 15:06 tylfin

Benchmarks

Benchmark execution time: 2025-06-27 18:24:06

Comparing candidate commit 9f3f1c50c45d7540edbda9fb64b3ac7cf51af297 in PR branch chore/remove-parse-isoformat with baseline commit 4b87ee8f2251e3cf22ea2a94c0fd51903a4275bd in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 451 metrics, 3 unstable metrics.

pr-commenter[bot] avatar Jun 27 '25 15:06 pr-commenter[bot]

The backport to 3.10 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-3.10 3.10
# Navigate to the new working tree
cd .worktrees/backport-3.10
# Create a new branch
git switch --create backport-13799-to-3.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 95298e23b569068498c7ada43c0db323b1babf8e
# Push it to GitHub
git push --set-upstream origin backport-13799-to-3.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-3.10

Then, create a pull request where the base branch is 3.10 and the compare/head branch is backport-13799-to-3.10.

github-actions[bot] avatar Jun 30 '25 13:06 github-actions[bot]

The backport to 2.21 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.21 2.21
# Navigate to the new working tree
cd .worktrees/backport-2.21
# Create a new branch
git switch --create backport-13799-to-2.21
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 95298e23b569068498c7ada43c0db323b1babf8e
# Push it to GitHub
git push --set-upstream origin backport-13799-to-2.21
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.21

Then, create a pull request where the base branch is 2.21 and the compare/head branch is backport-13799-to-2.21.

github-actions[bot] avatar Jun 30 '25 17:06 github-actions[bot]

The backport to 3.10 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-3.10 3.10
# Navigate to the new working tree
cd .worktrees/backport-3.10
# Create a new branch
git switch --create backport-13799-to-3.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 95298e23b569068498c7ada43c0db323b1babf8e
# Push it to GitHub
git push --set-upstream origin backport-13799-to-3.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-3.10

Then, create a pull request where the base branch is 3.10 and the compare/head branch is backport-13799-to-3.10.

github-actions[bot] avatar Jul 07 '25 12:07 github-actions[bot]