semantics icon indicating copy to clipboard operation
semantics copied to clipboard

Combine automatically generated boolean variables

Open n1kPLV opened this issue 3 years ago • 1 comments

The Netlist-based Compilation will generate excessive amounts of boolean variables with names like _g119 or _cg105. In generated Java code, each of these variables is declared a public boolean. While the amount of memory occupied by a public boolean variable is jvm specific, I doubt that many implementations will actually use less than one byte per boolean. As there are platforms with strict limits on the number of permitted fields (like the NXJ/leJOS platform) it might be sensible to try to combine these booleans for example into one java.util.BitSet.

Some of these generated fields may actually be redundant. (As in: are set to the same value a few codelines apart in which the value is not mutated and the values are not mutated at all.) These fields could probably be removed entirely without changing the program execution.

n1kPLV avatar Jan 14 '23 15:01 n1kPLV