Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Avoiding stat calls (again)

13 nov 2010 kl. 16:36 skrev Robin Rosenberg:

> This issue pops up again and again, I guess when one stops being tired of it. I got an idea that does not involve JNI.
> 
> If the time stamp hasn't changed, couldn't we assume size didn't change either? I believe
> all OS:es update the timestamp when we write to a file, not just on open/close.
> 
> Given some definition of old, we could avoid retrieving the file size if the (old) timestamp
> in the index equals the one on disk when checking for a possible modification. 
> 
> What would old be? 2 seconds (FAT) or much more?

See the Gerrit http://egit.eclipse.org/r/#change,1905. The main thing I wanted, was to make the Commit
dialog pop up faster. Now, what I found is that it actually opens and read every file, No wonder it
takes forever. Git is supposed to be fast.

Daemon Thread [ModalContext] (Suspended)	
	ContainerTreeIterator(WorkingTreeIterator).idBuffer() line: 213	
	ContainerTreeIterator(AbstractTreeIterator).idEqual(AbstractTreeIterator) line: 368	
	TreeWalk.idEqual(int, int) line: 696	
	TreeFilter$2.include(TreeWalk) line: 133	
	AndTreeFilter$List.include(TreeWalk) line: 162	
	TreeWalk.next() line: 551	
	IndexDiff.diff() line: 184	
	CommitActionHandler.buildIndexHeadDiffList(IProject[], IProgressMonitor) line: 324	
	CommitActionHandler.access$0(CommitActionHandler, IProject[], IProgressMonitor) line: 292	
	CommitActionHandler$1.run(IProgressMonitor) line: 100	
	ModalContext$ModalContextThread.run() line: 121	

The TreeWalk needs a better interface to the TreeIterators to support this cleanly and TreeWalk
must be able to receive parameters regarding how to compare with regards to filemode and crlf etc.

I think we need to break the TreeWalk API. Let's suprise Shawn when he gets back from vacation }:>

-- robin




Back to the top