szetszwo commented on PR #8203:
URL: https://github.com/apache/ozone/pull/8203#issuecomment-3697575151

   The 
[SynchronizedSpliterator](https://github.com/apache/ozone/pull/8203#issuecomment-2932317879)
 approach is inefficient -- Spliterator is designed to split a collection into 
multiple parts and then iterate the individual parts in parallel.
   
   For example, suppose there is a list with 10,000,000 elements and it is 
going to be processed by 100 threads.
   - Spliterator is designed to do the split first, say splitting it into 1000 
parts with 10,000 elements each.  Then, the 100 threads only have to be 
synchronized 1000 times for picking up the individual parts.
   - For SynchronizedSpliterator, since it has synchronized at tryAdvance(..), 
the 100 threads have to be synchronized 10,000,000 times for picking up the 
individual elements.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to