disjoint closure environments
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Refactoring
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- compilers, performance
Direzione di ricerca
No files or tests are named. Start by locating closure-environment construction and variable-capture handling in the compiler/runtime, then compare the disjoint and shared-variable examples in this issue. Done requires a justified strategy for splitting environments, including its indirection and allocation costs.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
the following function:
function foo() {
var a = [1,2,3,4];
var b = 1;
var c = 2;
var new_a = a.map (function (el) { return el * b; }
return function () {
return c;
}
}
will create a single closure environment holding both b (closed over by the function passed to map) and c (closed over by the returned function.)
In this totally disjoint case, ejs could split the closure environments, but I need to investigate if the overhead of splitting the closure makes sense for small environments (I'm guessing no for this particular case, particularly since the closed over variables are never set to anything other than primitives..)
Also, what happens if the sets are not totally disjoint? Take the following:
function foo() {
var a = [1,2,3,4];
var b = 1;
var c = 2;
var d = 4;
var new_a = a.map (function (el) { return el * b + d; }
return function () {
return c + d;
}
}
so now both functions close over d as well.
we could make 3 environments in this case;
env_0 = { d: 4 }
env_1 = { env: env_0, b: 1 }
env_2 = { env: env_0, c: 2 }
accesses to d get replaced with something different from within each function:
env_1.env.din the function passed tomapenv_2.env.din the returned function.
This also has a cost in the increased indirection to get to the d binding, so need some heuristic based on the number of accesses to d to determine if we should just create 1 environment.
- Lingua principale
- JavaScript
- Stelle
- 430
- Fork
- 20
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 toshok/echojs
-
How to use this on Windows?Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
bug easy spec
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
easy spec
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di toshok/echojs
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue help wanted
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
zmo2s/agent-toolbox#23 ·
-
[Bug]: [MCP/CLI] Bare loopback IP addresses (127.0.0.1:port) and hosts with ports fail to navigate due to erroneous scheme inferenceForse già presa @alok-108 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/playwright#43263 ·
I maintainer di solito rispondono entro 1 giorno
-
bug traffic
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 74/100