I started to examine my program for performance. Since i am making heavy use of assoc (and its relational “reading” ) i am wondering if there could be a significant performance advantage if the assoc library would be implemented in C (or C++?).
If the time spent is mostly lookup, the performance difference will not be big.
You need to understand the use case and profile to see where the time goes. If you often insert and remove items from the assoc, it will have to re-balance and this is written in Prolog.
On the other hand, if you are not inserting and removing often, you might even try to use dicts and see if that makes a difference.
So if you can see what is currently the bottle neck and understand your use case, it will be easier to make a decision before investing time into writing more code.
Do you have any idea how much of the total time of your test case goes into adding items to the assoc? Or for lookup? Once you know that you can at least put a hard upper limit to the possible benefits of optimizing this particular part of your program.
thinking about it – assoc is involved more than 30% of the computational time … that seems quite significant to me - i guess this is an area i should think about very carefully.