asautins opened a new pull request, #1669:
URL: https://github.com/apache/samza/pull/1669

   ## Summary
   
   Memoize `DirDiffUtil.areSameFile` in `DirDiffUtil.getDirDiff` to minimize 
calls to sun.nio.fs.*
   
   ## Details
   Profiling a real-world job showed ~38% of the time being spent in 
`DirDiffUtil.getDirDiff`.  Investigating it seems that the call to 
`DirDiffUtil.areSameFile` is the primary cause of `DirDiffUtil.getDirDiff` 
showing up high on this particular profile.  Looking at the code there is the 
following comment:
   
   ```
     // TODO MED shesharm: this compares each file in directory 3 times. 
Categorize files in one traversal instead.
   ```
   
   Looking at the profile we can achieve limiting the calls to `sun.nio.fs.*` 
methods by memoizing as an alternative approach.  The benefits of memoizing are 
that it's a relatively small change.  The downside is that memoizing takes 
memory to hold the memoized results.  In this scenario memoizing is scoped to 
the `DirDiffUtil.getDirDiff` method to limit the impact of memoization.
   
   
   JIRA=SAMZA-2783


-- 
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]

Reply via email to