Repository navigation
Skip interpolation work for literal dotenv values - #764
Open
xhl123XHL352 wants to merge 1 commit into
Open
xhl123XHL352 wants to merge 1 commit into
xhl123XHL352 wants to merge 1 commit into
Conversation
Assisted-by: OpenAI Codex <noreply@openai.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
resolve_variables()currently tokenizes every value and builds an environment mapping for it. The parser expands braced references, so values that have no${can be used directly.End-to-end benchmark
Called
dotenv_values(path)on synthetic.envfiles on Linux with CPython 3.12.16. Each entry below is the median of nine runs per revision, alternating their order. All parsed mappings were identical.With the lookup approach from #706 applied locally, the 5,000-literal workload went from 432.55 ms to 96.68 ms after adding this fast path.
Reproduce the 5,000-literal workload
Verification
.envabove the server checkouts.AI assistance: OpenAI Codex implemented the change and ran the benchmarks and tests above.