Add diversityScoreFunctionFor to avoid creation of wrapper object#592
Add diversityScoreFunctionFor to avoid creation of wrapper object#592
Conversation
|
Before you submit for review:
If you did not complete any of these, then please explain below. |
|
what's the score in the benchmark table above ? In the profile these allocations are 38% of all the allocations in the JVM, and this is very big |
The profile indicates that the results without this change are in the same neighborhood (due to error bounds) of performance. There is no reason to leave it in place though, and I agree with you that the profile may not have enough GC pressure to expose the hotspot. |
In a profile of CC, I found that we create
DefaultSearchScoreProvidermany times only to access its wrapped object. Here is a screen shot of the memory profile:We only ever create the
DefaultSearchScoreProviderto access theScoreFunctionit wraps. This PR adds a method to get directly to theScoreFunction.However, in running the benchmark, I found that there was no significant difference, so perhaps there is no real benefit. I am not sure whether we want to merge this based on the theory alone that we can avoid the allocation or if this is too insignificant to merge, considering @marianotepper plans to overhaul the whole design with #585