G3Kappa / Ergo

Other
4 stars 0 forks source link

Reduce unification memory footprint for abstract terms #39

Open G3Kappa opened 1 year ago

G3Kappa commented 1 year ago

Some results of unification could be represented more efficiently than they currently are: for instance, sub-lists could be represented as slices of a parent list.

G3Kappa commented 1 month ago

The improvements from the branch termvm mentioned in #77 are shedding light on how to tackle this issue. In fact, the issue is solving itself automatically.

The pointer representation of abstract terms lets you tag sublists as abstract terms by only creating an abstract pointer to them that shares the same type information as the parent list. Since unification happens entirely in pointer-land, this translates directly into a raw performance boost and decrease in memory usage.

The same logic should apply to other types as well, which is great.