From e944c341a78fffe475ddbe866275737a21991dc5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 6 Sep 2022 23:25:57 +0300 Subject: docs(tvix/eval): add optimisation note on eliminating `with` thunks Change-Id: I18d50ac8e157929a027f8bf284e65f1eb8950d5a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6488 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/docs/known-optimisation-potential.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tvix/eval/docs') diff --git a/tvix/eval/docs/known-optimisation-potential.md b/tvix/eval/docs/known-optimisation-potential.md index da9cf265ea..20884519cc 100644 --- a/tvix/eval/docs/known-optimisation-potential.md +++ b/tvix/eval/docs/known-optimisation-potential.md @@ -50,12 +50,6 @@ optimisations, but note the most important ones here. can directly use the `value::function::Lambda` representation where possible. -* Tail-call optimisation [hard] - - We can statically detect the conditions for tail-call optimisation. - The compiler should do this, and it should then emit a new operation - for doing the tail-calls. - * Optimise inner builtin access [medium] When accessing identifiers like `builtins.foo`, the compiler should @@ -81,3 +75,12 @@ optimisations, but note the most important ones here. For details consult the commit with Gerrit change ID `I96828ab6a628136e0bac1bf03555faa4e6b74ece`, in which the initial attempt at doing this was reverted. + +* Avoid thunks if only identifier closing is required [medium] + + Some constructs, like `with`, mostly do not change runtime behaviour + if thunked. However, they are wrapped in thunks to ensure that + deferred identifiers are resolved correctly. + + This can be avoided, as we statically analyse the scope and should + be able to tell whether any such logic was required. -- cgit 1.4.1