liquidsoap
liquidsoap copied to clipboard
Pre-compile to de Bruijn indices.
Get rid of sources of inefficiencies during evaluation.
- Use de Bruijn indices (integers) instead of variable names (which require string comparisons). In the current implementation this is somewhat counterbalanced by the fact that we restrict closures to the part which is really used (= free variables), but this operation is itself costly (we are filtering the whole environment).
- We constantly compute positions for values whereas we should not need that anymore apart from specific cases (e.g. for reporting encoder errors), which can be handled specifically. Internal errors are not supposed to happen...
- In many cases, we can pre-compute the order of application of arguments (especially since we dropped partial application), thus avoiding comparing labels.
Before I forget: things are quite complicated by the presence of labeled and optional arguments... I am not really sure how to get rid of those.