Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340352

Summary: [performance] [scalability] copying local artifacts has an unnecessary overhead of 0.1s
Product: [Eclipse Project] Equinox Reporter: Helmut J. Haigermoser <helmut.haigermoser>
Component: p2Assignee: Pascal Rapicault <pascal>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: irbull, pascal
Version: unspecified   
Target Milestone: 3.7 RC1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed change to get performance up pascal: iplog+, pascal: review+

Description Helmut J. Haigermoser CLA 2011-03-17 13:33:53 EDT
Build Identifier: 3.6

When mirroring artifacts locally from/to a SimpleArtiRepo the private "downloadArtifact" method has a minimum run time of 0.1 seconds(on my host), even for very small artifacts with a few bytes to copy. 

Replacing the "getTransport().download()" call with "FileUtils.copyStream()" speeds that up tremendously, which is why I suggest changing downloadArtifact to do that for "scheme == file" downloads...

The transport accepts a monitor so copyStream might need that too so that the UI can report proper progress on the copy stage...

Reproducible: Always

Steps to Reproduce:
1. Mirror artifacts from a file: URI
2. Check performance of copying each artifact
3. Notice that even very small artifacts seem to have a "copy overhead" of 100+ milli seconds
Comment 1 Pascal Rapicault CLA 2011-03-17 16:27:41 EDT
Could you please provide a patch?
Comment 2 Helmut J. Haigermoser CLA 2011-03-18 11:04:57 EDT
Created attachment 191516 [details]
Proposed change to get performance up

Hi Pascal :)
This is the proposed change, it's very small, a few lines really,
but I also tried to create a copy method accepting a progress monitor, not so sure about that one though, reporting every 16k will be a lot of monitor notifications for a bigger file..
HTH,
Helmut
Comment 3 Ian Bull CLA 2011-04-21 13:32:36 EDT
Pascal, do you want to apply this, or push it out to 3.8?
Comment 4 Pascal Rapicault CLA 2011-05-05 16:42:57 EDT
I've released the patch. It makes quite a difference !!! Thx for this.
Comment 5 Helmut J. Haigermoser CLA 2011-05-06 03:08:09 EDT
(In reply to comment #4)
> I've released the patch. It makes quite a difference !!! Thx for this.

Thanks for picking this up, I'm glad it helps! :)
Helmut