Bystroushaak / tinySelf

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

Speed optimization: Cache scope parents in code context. #90

Closed Bystroushaak closed 5 years ago

Bystroushaak commented 5 years ago

As the creation of the dicts is pretty costly, only place where objects aren't now cached and are frequently created is the ._create_intermediate_params_obj() method. It would be cool if the intermediate object could be cached too.

Bystroushaak commented 5 years ago

This did not prove to be effective.

Bystroushaak commented 5 years ago

I've realized that I can cache both versions of the object. I will need to do some perf tests.

Bystroushaak commented 5 years ago

Are the operations in _create_intermediate_params_obj() dependent on order?

Bystroushaak commented 5 years ago

They are not.

Bystroushaak commented 5 years ago

I've attempted another try to cache parameters, but because they are context dependent on previous frame (to add * parent or not), they can't be efficiently cached with current Object() implementation.

Note to future self: Don't try to invent anything smart in code_context and just save it into it externally from _create_intermediate_params_obj().

Bystroushaak commented 5 years ago

This issue simply doesn't let me sleep. Literally like five minutes before I fell into sleep, I've realized that cacheing can be probably done in different way, so here is another attempt.