Closed jitsedesmet closed 3 years ago
That's a good question. I think it depends on what you find most important. We could removethis.subTrees
and just perform a linear search over the new overLoads
array. This would only effect initialization time.
So, removing the this.subTrees
object would:
Should I remove it? I'm thinking yes.
Memory usage also has a performance impact with allocation/deallocation and such. Initialization cost is negligible, there is only one tree per function.
I think the key thing here is: will it make the code more clear and simpler? I feel it will.
Alright, so if everything agrees that removing this.subTrees
will be a good thing, let's go forward with that plan before merging this PR :-)
I give my :+1:
I assume this still works in Comunica as well?
Sure does! :)
Thanks!
This PR just removes the use of Object.entries in the
getSubTreeWithArg
function. This almost halves the execution time of the new type system when not using a cache or when the cache misses.It can be seen as a part of #119 and might provide an example of the kind of optimizations we need.