orc-lang / orc

Orc programming language implementation
https://orc.csres.utexas.edu/
BSD 3-Clause "New" or "Revised" License
40 stars 3 forks source link

Minor memory consumption issue #135

Closed GoogleCodeExporter closed 7 years ago

GoogleCodeExporter commented 9 years ago
Description of Change:

Change nameless.Expression.withNames (and others) from lazy val to def.

Benefit of/Reason for Change Request:
A lazy val adds a field (2 fields if it is the first lazy val in the class) to 
every instance of the class. Since withNames is only called in prettyprint() 
which is never used in the main execution path there is no reason to optimize 
for multiple calls to withNames. The memory saved would be small, but there is 
no disadvantage and it might slightly improve cache behavior.

Original issue reported on code.google.com by arthur.peters on 11 Dec 2014 at 1:37

arthurp commented 7 years ago

Small optimizations on the token interpreter are not useful in light of the Orctimizer work. If we want performance we need a compiler and we now know it's possible.