Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.3.4
-
None
-
all
Description
The performance of the Upload Artifact page is absolutely dreadful.
Technically this is probably an enhancement, rather than a bug... but it is so bad in current form I'm filing it as a bug.
The UploadAction class uses what must be the worst copy file
implementation possible.
It says:
FileOutputStream out = new FileOutputStream( new File(targetPath, targetFilename ) );
FileInputStream input = new FileInputStream( sourceFile );
try
{
int i;
while ( ( i = input.read() ) != -1 )
out.flush();
}
Alternating between reading and writing one bit at a time???? No
wonder it was taking me over a 1/2 hour to try to upload a simple 150
MB file (with the CPU locked at 100% utilization). Wow.
Please replace that implementation with this (or similar):
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(new File(targetPath, targetFilename)));
BufferedInputStream input = new BufferedInputStream(new FileInputStream(sourceFile));
try
{
byte[] buf = new byte[1024];
int len;
while ((len = input.read(buf)) > 0)
out.flush();
}
Tis about 100 orders of magnitude faster.