gortiz opened a new pull request, #12783:
URL: https://github.com/apache/pinot/pull/12783

   A small PR that changes SortOperator to buffer entries in an ArrayList 
instead of a LinkedList.
   
   In general LinkedList performance is horrible, even in cases when 
theoretically (by Big-O) they are fine, usually the performance cost is worse 
than ArrayList due to memory amplification and cache issues. In the specific 
case this PR is changing, there was no actual reason to use LinkedList apart 
from a slightly nicer code. But given the size of the final result is well 
know, it was very easy to change it to an ArrayList implementation where the 
ArrayList is initialized to all values being null and then set values in the 
reverse direction. Amortized BigO cost is still linear, but locallity and 
allocation should be quite better in this implementation.
   
   A secondary but difficult to prove improvement is related to megamorphic 
calls. As we mostly always use ArrayList in our code, the JIT can generate code 
that assumes that. Sometimes we need to use different lists, but if we can 
avoid that we theoretically can produce better code.
   
   Probably the performance cost will be negligible in most cases and some of 
the actual cases (like the megamorphic calls) cannot be easilly benchmarked 
with JMH, so I'm not adding these benchmarks in this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to