Bystroushaak / tinySelf

Self-like language implemented in the RPython language toolkit.
29 stars 3 forks source link

Optimize method lookup by static compilation of method names to numbers. #13

Closed Bystroushaak closed 5 years ago

Bystroushaak commented 6 years ago

Object is recompiled each time some of its slots, or parent slots changes.

Requires parent compilation version number variable in each object and also some kind of lookup dictionary* which will check when whether the compilation number is same.

*Or maybe don't store pointers to objects, but pair (parent, version).

Bystroushaak commented 5 years ago

It didn't prove to be working correctly, as most of the objects parent tree version changes too often, so it triggered recompilation / cache invalidation every time. Also, fallback from the optimized recompiled code back is hard, as it needs to push back string literals for message names, which may be impossible.