Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #32076, compile times of long static vectors #32105

Merged
merged 1 commit into from
May 22, 2019
Merged

Conversation

JeffBezanson
Copy link
Member

This adds some heuristics to do less constant propagation. I did some profiling to see which functions get constant prop'd the most, then tried to exclude cases that don't seem useful:

Adds some heuristics to avoid constant propagation in cases unlikely to
be useful: getindex and setindex! of non-const arrays, iterate of
non-const objects, and arithmetic with some non-const args.
@JeffBezanson JeffBezanson added the compiler:latency Compiler latency label May 21, 2019
@JeffBezanson JeffBezanson merged commit e249319 into master May 22, 2019
@JeffBezanson JeffBezanson deleted the jb/fix32076 branch May 22, 2019 20:07
@stev47
Copy link
Contributor

stev47 commented Apr 12, 2020

This bit me. Is there a way to opt into constant propagation for getindex?
As soon as I'm subtyping AbstractArray, getindex loses constant propagation. I could change the user-facing indexing syntax but that seems awkward to do just for efficiency reasons.
I tried to work around by defining Base.issingletontype(...) = true (technically wrong since my type is non-singleton) but that does not seem to have any effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:latency Compiler latency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation times of long static vectors are increasing
2 participants