Repository navigation
Conversation
slozier
approved these changes
Nov 5, 2026
|
|
||
| case "NoAdaptiveCompilation": | ||
| LanguageSetup.Options["NoAdaptiveCompilation"] = ScriptingRuntimeHelpers.True; | ||
| if (val != null) { |
Contributor
There was a problem hiding this comment.
Maybe LanguageSetup.Options.Remove("NoAdaptiveCompilationFilter")?
| } | ||
|
|
||
| internal bool ShouldInterpret(PythonCompilerOptions options, SourceUnit source) { | ||
| if (IsAdaptiveCompilationDisabled(source)) { |
Contributor
There was a problem hiding this comment.
This does a regex match on every call that has a filter? I guess it's probably lost in the noise.
Member
Author
There was a problem hiding this comment.
Good catch. There is a cache in PythonAst, applicable to functions, generators and class bodies in imported modules and exec/eval code, but not for module bodies and a few other code paths. I will push an update.
I've also noticed that -X Debug -X NoDebug=… runs its filtering regex on each read. I leave it to whoever will be fixing -X Debug.
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.
This resolves the last question from #2126. Most compilation options cover all code (
CompilationThreshold,Tracing,NoFrames/Frames/FullFrames,GCStress,MaxRecursion,EnableProfiler,-O/-OO), soNoAdaptiveCompilation(which compiles unconditionally) naturally should do the same. But since disabling adaptive compilation for all code significantly increases start time (though not as much as-X CompilationThreshold=0), I opted for an optional regex to filter modules to where the adaptive compilation should be disabled.In a way how
-X Debugand-X NoDebug=<regex>used to work.However, something seems wrong with
Debug/NoDebug. It does not apply to anything beyond__main__since #599. That's a separate issue, I am not pursuing it.