MNT: disable the coercion cache for the nogil build #26294
Merged
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 disables the coercion cache on the nogil build, but I'd like to find a benchmark that shows the benefit of this cache more than what's already in
bench_array_coercion.py
andbench_core.py
.I don't see any significant performance impact before or after this change, although note that I can't actually run asv in comparison mode yet in the nogil build.
When I disable this cache for the single-threaded build (e.g. set
COERCION_CACHE_CACHE_SIZE
to 0 in both branches of the ifdef) where I can run asv in comparison mode, I get the following results:So it does have a small, ~5% benefit for a few of the array coercion tests, but a somewhat confusing mix of performance improvements and performance hits for reduction operations, and two other 10% performance hits for creating an array from a single-element list and a benchmark for
count_nonzero
withaxis
set.Maybe this is all just noise?