You haven't said how big the response content is, which certainly can be a
factor. I looked at the EntityUtils.toString() source code in HttpCore 4.0.1
and it is basically using an InputStreamReader to decode the entity into a
String, using a 1024 character buffer. Are you sure you want the entity as a
string? Can you process it as a stream? AFAIK HTTPClient does allows for
stream processing of the response. This is usually much more efficient than
copying the whole thing into a memory buffer.

On Sat, Jan 2, 2010 at 10:24 AM, SizzlingSkizzorsProgrammer <
[email protected]> wrote:

> Thanks!
>
> After doing a TraceView, I found that most of the processing time is
> spent in the EntityUtils.toString(entity); portion...any ideas how to
> speed it up/circumvent this step?
>
> On Jan 2, 12:47 am, Brion Emde <[email protected]> wrote:
> > I think that it is automatic. Just be sure to keep your HttpClient
> > object around for as long as you're going to be using it. For example:
> > create the HttpClient in your onCreate() and close it in onDestroy()
> > for your activity.
> >
> > On Jan 1, 10:45 pm, SizzlingSkizzorsProgrammer <[email protected]>
> > wrote:
> >
> >
> >
> > > Thanks a lot!  Just wondering:  how do you set the keep-alive
> > > setting?  I just can't seem to get it!
> >
> > > Thanks for all your help!
> >
> > > On Jan 1, 5:08 pm, Frank Weiss <[email protected]> wrote:
> >
> > > > I've seen 5 sec occasionally getting an rss feed of about 28 KB using
> > > > java.net.URL.openConnection().getInputStream() and then parsing it
> with
> > > > SAXParser. It looks like you're doing a POST to send form data(?) so
> you may
> > > > have to stick with HTTPClient.
> >
> > > > If you're doing frequent requests, you can probably take advantage of
> > > > HTTPClient's "keep-alive" connection management.
> >
> > > > If you're looking for optimizations, I strongly suggest you create a
> test
> > > > app which performs the samerequestyou're having performance problems
> with.
> > > > Collect more data, such as the size of therequestand response. Try
> the
> > > > samerequestfrom a different platform (like your laptop or desktop).
> > > > Compare the network paths between the desktop and Android to the
> server.
> >
> > > > I know you'd like to just get an answer "do this/try this". I hope
> that by
> > > > looking into the problem in more detail you''ll find a solution.
> >
> > > > On Fri, Jan 1, 2010 at 3:36 PM, SizzlingSkizzorsProgrammer <
> [email protected]
> >
> > > > > wrote:
> > > > > About 5 seconds, which isn't unbearable, but considering my app
> needs
> > > > > frequent requests some kind of optimization must be possible.
> >
> > > > > Look at the android market...it seems to load everything pretty
> fast
> > > > > (much faster than my app at least!)
> >
> > > > > On Jan 1, 3:15 pm, Frank Weiss <[email protected]> wrote:
> > > > > > Considering that the execute method's latency includes network
> and server
> > > > > > times, on what basis do you think it's taking too long? What
> latency are
> > > > > you
> > > > > > observing, less than one second, more than one minute?
> >
> > > > > > On Fri, Jan 1, 2010 at 1:19 PM, SizzlingSkizzorsProgrammer <
> > > > > [email protected]
> >
> > > > > > > wrote:
> > > > > > > Yes, I've tried logging and theHTTPexecute definitely takes the
> > > > > > > largest chunk of time, but how can I speed it up?  Is there
> another
> > > > > > > protocol/method?
> >
> > > > > > > On Dec 31 2009, 6:07 pm, jotobjects <[email protected]>
> wrote:
> > > > > > > > On Dec 31, 12:52 pm, SizzlingSkizzorsProgrammer <
> [email protected]>
> > > > > > > > wrote:
> >
> > > > > > > > > It works fine, but it's quite slow...any way to make it
> faster?
> >
> > > > > > > > A guess would be that theHTTPnetwork speed is 100's of times
> slower
> > > > > > > > than all the rest of the code. You might log the time before
> and
> > > > > after
> > > > > > > > the execute method if you haven't already done that.
> >
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the
> Google
> > > > > > > Groups "Android Developers" group.
> > > > > > > To post to this group, send email to
> > > > > [email protected]
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > [email protected]<android-developers%[email protected]><android-developers%2Bunsubs
> [email protected]><android-developers%2Bunsubs
> > > > > [email protected]>
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/android-developers?hl=en
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "Android Developers" group.
> > > > > To post to this group, send email to
> [email protected]
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<android-developers%[email protected]><android-developers%2Bunsubs
> [email protected]>
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to