1lab/mikan
13
52
Fork
You've already forked mikan
9

perf: remove instantiateFull in killArgs #134

Merged
amyliao merged 1 commit from aliao/killargs-perf into main 2026年06月11日 00:14:48 +02:00

Addresses a performance issue with long telescopes that @totbwf minimized out of investigating !133. It does not address the actual issue described there, only this tangential minimization.

Addresses *a* performance issue with long telescopes that @totbwf minimized out of investigating !133. It does not address the actual issue described there, only this tangential minimization.
perf: remove instantiateFull in killArgs
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
1a2bac6cfb
The code was already using forceNotFree to try removing the offending
variables if necessary, so all that was needed to actually get it
working was a minor adjustment to the ForceNotFree instances to make
sure they actually reach everywhere that a MaybeFree variable might be
hiding.
Fixes a pretty bad case of quadratic type-checking time for long
telescopes, see test/Succeed/OccursCheckInstantiate, where the issue was
instantiateFull quadratically re-traversing the prefix of the telescope
up to the meta to decide how to prune f out of the metavariable standing
for its type: in each argument we had
 A(7 + n) : ∀ a b c d e (f : ?0) → _≡_ {?1 f} f (A6 a b c d e)
 ?1 f := ?0
except the meta ?1 from which we were trying to kill f was also applied
to the entirety of An telescope up to A(7 + n), and the sorts of those
variables were *also* metas, and instantiateFull wanted to traverse
*all* of these sorts. However Occurs was basically already using the
rapier approach to free variable handling so we just had to remove the
quadratic sledgehammer.
Testing performance regressions is kinda difficult, though, and I can
only hope that 64M is enough heap to pass in CI!
amyliao force-pushed aliao/killargs-perf from 1a2bac6cfb
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
to b168a06b76
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/main Pipeline was successful
2026年06月10日 23:44:47 +02:00
Compare
amyliao deleted branch aliao/killargs-perf 2026年06月11日 00:14:49 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
1 - scope
language
Backwards-compatible changes to the surface language, such as adding new features.
1 - scope
language change
Breaking changes to a documented part of the surface language. These should be documented and specifically called out in the changelog.
1 - scope
performance
Semantics-preserving performance work.
1 - scope
task
Changes that are not apparent to the user, e.g. developer documentation and refactors, which do not need to be documented.
A: dead-code
Dead code elimination and --save-metas.
A: errors
Reporting of error and warning messages.
A: highlighting
Highlighting during interaction & literate compilation
A: imports
Handling of imports and interface file de/serialization.
A: infra
Iinfrastructure (e.g. CI, developer documentation, the build system, or the repository itself)
A: instance
Instance declarations, arguments, and resolution
A: lhs
LHS checking, coverage checking, and clause compilation
A: modules
Declaration and instantiation of parametrised modules.
A: parallel
Parallel typechecking.
A: positivity
Positivity checking
A: printing
Pretty-printing, display forms, and the wording of diagnostic messages
A: records
Record declarations, record expressions and copattern matching
A: scoping
Scope checking (ConcreteToAbstract)
A: termination
Termination checking
0 - type
bug
Issues describing an incorrect behaviour in the project, typos in the documentation, etc.
0 - type
discussion
An issue raised to gather opinions on a proposed change, or a suggested language change.
0 - type
question
An issue raised to ask a question.
9 - status
duplicate
This issue or pull request already exists.
9 - status
info needed
More information is needed from the submitter to decide how to proceed with the issue report.
9 - status
invalid
The issue report or pull request does not describe an actual bug, or does otherwise does not meet the contributing guidelines.
good first issue
Interested in contributing? Get started here.
upstream
Related to an upstream repository, already reported there
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
1lab/mikan!134
Reference in a new issue
1lab/mikan
No description provided.
Delete branch "aliao/killargs-perf"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?