Re: Slow with direct action on mavericks 10.9.2

Jürgen Rohrbach <[email protected]> Fri, 2 May 2014 10:21:11 +0200
Newsgroups gmane.comp.web.webobjects.wonder-disc
Message-ID <[email protected]>
Hello,

i found out on other thing.
when i start more downloads parallel the speed for each download is  
the same as when i download only one file.


Thanks,

Jürgen




Am 30.04.2014 um 15:12 schrieb Aaron Rosenzweig:

> Hi Jürgen, that’s certainly annoying.
>
> For “giggles” perhaps try a “BufferedInputStream” to encapsulate  
> your FileInputStream. See what happens.
>
> What is truly best “depends” but since you are feeling pain right  
> now just try it out. Here’s some discussion of when one approach is  
> better than another:
>
> http://stackoverflow.com/questions/3122422/usage-of- 
> bufferedinputstream
>
> After reading that I’d suspect “buffered” to be slower for you but  
> maybe not - I can’t picture all the dependent pieces in my head.  
> Buffering may help you out so give it a shot.
>
> For what it is worth, ERAttachment chooses to do buffering. look at  
> the code in:
>
> ERAttachmentRequestHandler.handleRequest()
>
> Cheers,
> Aaron Rosenzweig / Chat 'n Bike
> e:  [email protected]  t:  (301) 956-2319
>
>
> On Apr 29, 2014, at 7:59 AM, Jürgen Rohrbach <juergen.rohrbach@xs- 
> solutions.de> wrote:
>
>> hello,
>>
>> i have a empty erxapplication with only on direct action.
>> the direct action streams a large file.
>> the problem is that i only get about 120kB/s download speed.
>> does anybody have a solutions for this problem?
>> this problem does not exits perior to mavericks!
>>
>>
>>
>>
>>
>>
>> 	public WOActionResults downloadAction() throws Exception {
>> 		WOResponse aResponse = WOApplication.application
>> ().createResponseInContext(null);
>> 		
>> 		// contentTyp
>> 		String contentType = "application/octet-string";
>> 		String filepath = "large.tif";
>> 		
>> 		aResponse.setHeader(contentType, "Content-type");
>> 		File f = new File(filepath);
>> 		int bufferSize = 10000000;
>> 		aResponse.setContentStream(new FileInputStream(f), bufferSize,
>> (long) f.length());
>> 		String fileName = NSPathUtilities.lastPathComponent( filepath );
>> 		aResponse.setHeader("inline; filename="+fileName, "Content-
>> disposition");
>> 		return aResponse;
>> 	}
>>
>>
>> --------------------------------------------------------------------- 
>> ---------
>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For  
>> FREE
>> Instantly run your Selenium tests across 300+ browser/OS combos.  Get
>> unparalleled scalability from the best Selenium testing platform  
>> available.
>> Simple to use. Nothing to install. Get started now for free."
>> http://p.sf.net/sfu/SauceLabs
>> _______________________________________________
>> Wonder-disc mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wonder-disc
>

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs

_______________________________________________
Wonder-disc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wonder-disc
Bild 7.png (application/applefile, 70 B) - not displayed
Bild 7.png (image/png, 31.8 KB) - not displayed