Speed up Thiele continuum approximation; pluggable evaluation strategy - #35
Merged
Conversation
…luator selection mechanism
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Benchmark ResultsRatios above 1 mean this PR is slower than
Benchmark PlotsPlots have been uploaded as an artifact to this workflow run |
Member
Author
|
@JuliaRegistrator register Release notes:
|
|
Comments on pull requests will not trigger Registrator, as it is disabled. Please try commenting on a commit or issue. |
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.
Summary
Memory- and type-stability work on the Thiele continuum
approximatepath, plus a cleaner mechanism for selecting evaluation strategies. All 925 tests pass; no behavioral changes to results (the two recurrences agree to ~1e-15).Performance (vs.
main, median viabenchmark/compare.jl)exp_interval/tanh_steep/abs_circleexp_interval/tanh_steep/abs_circlethiele_vector(scalarr.(z))approximate,bary_vectorWhat changed
evaluate!scratch reuse: newevaluate!(t, r, z, a, b)overload lets the hot loop reuse the recurrence's work arrays instead of allocating per call; the 3-arg form delegates to it.active), grown incrementally and rebuilt only on path reset, supporting a non-rectangular active set. Test points are gathered into a dense reusable buffer soevaluate!runs on contiguous vectors._sweep!): the per-point work is routed through a single barrier function (two methods) so it specializes on concrete element types. This is necessary because ComplexRegions'point(d, ·)infers asAny, makingσ/fσ/fτ/buffers abstract insideapproximate.DiscretizedPath.pointsparameterized (Matrix{P}) — fixes an abstract field type and benefits all consumers (Barycentric,parfrac,spacing,collect)._evaluator/_new_weighttoggles (which forced a dynamic dispatch + heap box on every scalar evaluation) with strategy singletonsOneDiv/Classic <: ThieleMethod. The default path is now a static, allocation-free call;evaluate(r, z, method)/add_node!(r, z, y, method)take an optional explicit strategy, andset_eval_method/set_weight_methodretain the global-switch capability for tests.API additions (exported)
ThieleMethod,OneDiv,Classic,set_eval_method,set_weight_method.Housekeeping
0.3.7.ComplexRegionscompat to0.3.9(earlier0.3allowed 0.3.7, which lackspointsused by the Barycentric path).benchmark/compare.jl, a before/after benchmark harness.