moosetechnology / Famix

An abstract representation of source code. Famix is generic and can describe applications in multiple programming languages.
MIT License
12 stars 22 forks source link

Speed up #source and #target on associations #770

Closed jecisc closed 1 month ago

jecisc commented 1 month ago

It is common to manipulate the sources and targets of associations in moose but in case we need them extensively it can take some time to get them because we compute them from the meta description.

In this change I'm adding a cache to get the source and target selectors which speed up quite a bit the code.

I had a piece of code taking 200ms that got down to 28ms with this change. Out of the 28ms, only 2ms are now spent in getting the source and target