Open dluksza opened 8 months ago
Did you try if this also happens when using JGit from current master branch ?
Not yet, for now, was just browsing the code and it looks like although the stacktrace doesn't match fully it should behave similarly. Will test it on the master
now.
Yes, it is still the case, here's the stacktrace from master
:
Thread [main] (Suspended (breakpoint at line 212 in LooseObjects))
LooseObjects.getObjectLoader(WindowCursor, File, AnyObjectId) line: 212
LooseObjects.open(WindowCursor, AnyObjectId) line: 171
ObjectDirectory.openLooseObject(WindowCursor, AnyObjectId) line: 418
ObjectDirectory.openLooseFromSelfOrAlternate(WindowCursor, AnyObjectId, Set<Id>) line: 394
ObjectDirectory.openObjectWithoutRestoring(WindowCursor, AnyObjectId) line: 369
ObjectDirectory.openObject(WindowCursor, AnyObjectId) line: 350
WindowCursor.open(AnyObjectId, int) line: 133
WindowCursor(ObjectReader).open(AnyObjectId) line: 216
RevWalk.parseAny(AnyObjectId) line: 1119
TransportHttp$SmartHttpFetchConnection(BasePackFetchConnection).markAdvertised(AnyObjectId) line: 1101
TransportHttp$SmartHttpFetchConnection(BasePackFetchConnection).markRefsAdvertised() line: 1093
TransportHttp$SmartHttpFetchConnection(BasePackFetchConnection).doFetch(ProgressMonitor, Collection<Ref>, Set<ObjectId>, OutputStream) line: 408
TransportHttp$SmartHttpFetchConnection.doFetch(ProgressMonitor, Collection<Ref>, Set<ObjectId>, OutputStream) line: 1565
TransportHttp$SmartHttpFetchConnection(BasePackFetchConnection).fetch(ProgressMonitor, Collection<Ref>, Set<ObjectId>, OutputStream) line: 351
TransportHttp$SmartHttpFetchConnection(BasePackFetchConnection).fetch(ProgressMonitor, Collection<Ref>, Set<ObjectId>) line: 343
FetchProcess.fetchObjects(ProgressMonitor) line: 290
FetchProcess.executeImp(ProgressMonitor, FetchResult, String) line: 182
FetchProcess.execute(ProgressMonitor, FetchResult, String) line: 105
TransportHttp(Transport).fetch(ProgressMonitor, Collection<RefSpec>, String) line: 1482
FetchCommand.call() line: 238
CloneCommand.fetch(Repository, URIish) line: 319
CloneCommand.call() line: 189
Clone.run() line: 131
Clone(TextBuiltin).execute(String[]) line: 239
Main.execute(String[]) line: 247
Main.run(String[]) line: 135
Main.main(String[]) line: 106
For each advertised object we'll do a try-catch and re-throw the FileNotFoundException
as you can tell from the LooseObjects.getObjectLoader()
source code.
Would it be possible to have a different implementation of ObjectDirectory
only for the clone operation? We can safely assume during the clone that we don't have any of the objects. WDYT?
I think using a different ObjectDirectory implementation would be overkill, it looks like this could be fixed by skipping the call to #openLooseFromSelfOrAlternate(WindowCursor, AnyObjectId, Set<AlternateHandle.Id>)
in #openObjectWithoutRestoring(WindowCursor, AnyObjectId)
[1] if we know we are executing a clone. We already have a few other such optimizations for clone.
Version
5.13
Operating System
MacOS
Bug description
Bugzilla bug
Actual behavior
Clone operation is slow
Expected behavior
Speed improvement in clone operation
Relevant log output
No response
Other information
No response