RFC: Performance improvement in `lean_mark_persistent` and `lean_mark_mt`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #16375 di @zgrannan — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Ambito
- performance
Direzione di ricerca
Start with src/runtime/object.cpp around lean_mark_persistent and inspect the corresponding lean_mark_mt implementation. Review the linked implementation and benchmark results, then check the existing runtime tests and benchmark suite for coverage of persistent marking. Done means both paths preserve correct object marking and the benchmark confirms the reported instruction reduction; linked pull request #16375 is closed and unmerged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
lean_mark_persistent implements a worklist loop where each iteration pops an object o and:
- checks
!lean_is_scalar(o) && lean_has_rc(o); - if the check succeeds, runs
lean_internal_set_rc(o, 0)and pushes all ofo's children onto the worklist.
I think we can improve performance by moving the check and the update to the push:
- only pushing a child
cif!lean_is_scalar(c) && lean_has_rc(c), and - calling
lean_internal_set_rc(c, 0)just before adding it to the worklist
This has two benefits:
- fewer buffer operations, since scalars and already-persistent objects are never added to the buffer;
- the worklist never holds the same object twice.
I've implemented this change here, applying the same restructuring to lean_mark_mt. Running the benchmark suite locally I get 0.96% drop in build//instructions.
- Lingua principale
- Lean
- Stelle
- 10.3k
- Fork
- 1.1k
- Merge medio
- 19h 8m
- PR unite (30g)
- 421
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di leanprover/lean4
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
leanprover/lean4#16681 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
leanprover/lean4#16305 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
leanprover/lean4#16299 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
leanprover/lean4#16257 ·
I maintainer di solito rispondono entro 1 giorno
-
`IO.FS.realPath` reports every failure as `noFileOrDirectory` instead of classifying by `errno`Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
leanprover/lean4#15683 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di leanprover/lean4
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
blacklanternsecurity/bbot#3679 ·
I maintainer di solito rispondono entro 2 giorni
-
sync cache dist/imgAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
oleeskild/digitalgarden#435 ·
-
Optimize formulaArg struct memory layout to reduce formula matrix allocationForse già presa @shcabin l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 6 giorni
-
Cache AI SummaryAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
SimonHalvdansson/Harmonic-HN#432 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
TigreGotico/scriptconv#408 ·
I maintainer di solito rispondono entro 1 giorno