Re: [Simple-support] Android performance - strange profiling
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2012-01-14 01:19:04
|
I am sure its possible to speed things up quite signifigantly, ill take a close look and see what is going on that is taking up the time. However, first time reads will always take longer, as it needs to scan for annotations. ________________________________ From: Robert Massaioli <rob...@gm...> To: Niall Gallagher <gal...@ya...> Cc: Rangel Reale <ran...@gm...>; "sim...@li..." <sim...@li...> Sent: Saturday, 14 January 2012 12:15 PM Subject: Re: [Simple-support] Android performance - strange profiling That response is interesting. Is it possible that if the stack is going too deep then that is causing a slowdown? Also, I just found the benchmark code in the simple-xml repository and this is what it displayed for me on my computer: Execution of JAXB Test 1 10000 times: read=1229 ms read-total=1358 write=824 ms write-total=824 ms average-read=0 ms average-write=0 ms Execution of Simple Test 1 10000 times: read=1729 ms read-total=1736 write=1346 ms write-total=1346 ms average-read=0 ms average-write=0 ms Execution of JAXB Test 2 10000 times: read=614 ms read-total=618 write=241 ms write-total=241 ms average-read=0 ms average-write=0 ms Execution of Simple Test 2 10000 times: read=744 ms read-total=747 write=709 ms write-total=709 ms average-read=0 ms average-write=0 ms Execution of JAXB Test 3 10000 times: read=551 ms read-total=554 write=247 ms write-total=247 ms average-read=0 ms average-write=0 ms Execution of Simple Test 3 10000 times: read=719 ms read-total=721 write=699 ms write-total=699 ms average-read=0 ms average-write=0 ms So there is a significant speedup after the first run but it is still a little bit on the slow side. This code also only uses a single core to do the processing so since I have 4 3.3GHz cores in this computer and Android devices commonly have 1.2GHz cores it is easy to see the correlation in speed. That said the speed results are pretty close to JAXB, which makes me think that if I want to get to the speeds that I eventually desire that I might have to hand write a SAX parser or something. It would be good to get Simple XML to run in a second on an Android device, but that would mean it would have to double the efficiency that it is currently running at and get those benchmarks into the 300-400ms range. On Sat, Jan 14, 2012 at 11:54 AM, Niall Gallagher <gal...@ya...> wrote: Hi, > >Ill take a look at this. It seems very strange that it would spend 44% of its time on this method. Perhaps the profiler you are using is a sampling profiler, and it simply has not got enough samples to determine where the time is being lost accurately. At any rate I will look in to it. The problem I have had with profiling is that Simple uses a lot of recursive algorithms, so profiling by method visits etc is not very useful. I will try to write some tests to profile individual non-recursive parts separately, perhaps there are some gains to be made, likely with reflection I would think, but also with how the schema is constructed and used internally. > >Thanks, >Niall > > >From: Rangel Reale <ran...@gm...> >To: sim...@li... >Sent: Tuesday, 10 January 2012 5:00 AM >Subject: [Simple-support] Android performance - strange profiling > > > >Hello, > > >I am having performance issues in Android parsing a very large XML file. > > >Profiling trying to find where the bottleneck is, if I undestood correctly, the application is 44% of the time in the function "KXmlParser.getLineNumber", called from PullReader$Start.<init>, but looking at its source code it seems to only read an instance variable an nothing more. > > >Can someone shed a light on this? > > >I don't know it posting images is allowed here, so I uplodaded to an image sharing site: > > >http://imgur.com/C5ocm > > >Thanks, >Rangel > >------------------------------------------------------------------------------ >Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex >infrastructure or vast IT resources to deliver seamless, secure access to >virtual desktops. With this all-in-one solution, easily deploy virtual >desktops for less than the cost of PCs and save 60% on VDI infrastructure >costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox >_______________________________________________ >Simple-support mailing list >Sim...@li... >https://lists.sourceforge.net/lists/listinfo/simple-support > > > >------------------------------------------------------------------------------ >RSA(R) Conference 2012 >Mar 27 - Feb 2 >Save $400 by Jan. 27 >Register now! >http://p.sf.net/sfu/rsa-sfdev2dev2 >_______________________________________________ >Simple-support mailing list >Sim...@li... >https://lists.sourceforge.net/lists/listinfo/simple-support > > |