Skip to content

Commit

Permalink
Remove unhelpful memoization.
Browse files Browse the repository at this point in the history
These properties where unexpectedly *not* memoized before the work
on the linked langkit issue. The fix for that issue correctly turned
them into memoized properties, but it turns out that memoizing those
does not help: performance is not improved while memory footprint
increases.

This patch therefore makes these properties not memoized again.
  • Loading branch information
Roldak committed May 21, 2024
1 parent 921c206 commit d0d1c3e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ada/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3461,8 +3461,7 @@ def array_ndims():
is_array = Property(Entity.array_ndims > 0, dynamic_vars=[origin])

@langkit_property(return_type=T.BaseTypeDecl.entity,
dynamic_vars=[origin],
memoized=True)
dynamic_vars=[origin])
def expr_type():
"""
Return the type declaration corresponding to this basic declaration
Expand Down Expand Up @@ -7024,7 +7023,7 @@ def direct_primitives_env():
transitive_parent=False
)

@langkit_property(memoized=True)
@langkit_property()
def primitives_env():
return EmptyEnv

Expand Down

0 comments on commit d0d1c3e

Please sign in to comment.