SandishKumarHN commented on issue #7890: Set Test timeout higher for robust 
performance
URL: https://github.com/apache/incubator-druid/pull/7890#issuecomment-502845494
 
 
   @jihoonson below synchronized block is taking around ~80 ms but for 
getSegmentFiles one thread is taking ~75ms all others are ~1ms.
   
   `synchronized (lock) {
         try {
           segmentFiles = getSegmentFiles(segment);
         }
         finally {
           unlock(segment, lock);
         }
       }`
   and changed NUM_THREAD to 1 instead of 4 (default), full test time reduced 
to ~500ms from ~5000ms with 4 threads
   
   Looks like getting lock is significant overhead to the methods since it 
requires acquiring a lock when entering the method - or at least checking 
whether the current thread already possesses the lock. These operations are 
quite expensive and they have to be done every single time one of the methods 
is entered. Since - due to the recursion - this happens a lot, it has an 
extreme impact on the program performance.
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to