Re: [PATCH] Add a basic date format check to DIDL-Lite parser
- From: Sven Neumann <s neumann raumfeld com>
- To: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>
- Cc: "gupnp-list gnome org" <gupnp-list gnome org>
- Subject: Re: [PATCH] Add a basic date format check to DIDL-Lite parser
- Date: Mon, 18 Jul 2011 09:37:22 +0200
On Mon, 2011-07-18 at 01:23 +0300, Zeeshan Ali (Khattak) wrote:
> On Sun, Jul 17, 2011 at 5:52 PM, Jens Georg <mail jensge org> wrote:
> > On Do, 2011-07-14 at 01:49 +0300, Zeeshan Ali (Khattak) wrote:
> >> Hi,
> >>
> >> On Mon, Jul 11, 2011 at 11:48 AM, Sven Neumann <s neumann raumfeld com> wrote:
> >> > On Mon, 2011-07-11 at 09:58 +0200, Jens Georg wrote:
> >> >> > Could we try to keep the DIDL-Lite parser as efficient as possible? It
> >> >> > is already rather slow the way it is implemented right now. This is a
> >> >> > real problem on embedded devices.
> >> >>
> >> >> Can you point out the other issues you're seeing? Maybe we can fix them
> >> >> this cycle?
> >> >
> >> > I can't point at a particular issue. All I can say is that parsing
> >> > DIDL-Lite takes a considerable amount of CPU cycles. It might help to
> >> > use a SAX based parser instead of building the DOM, but that would be a
> >> > major rewrite of gupnp-av and I am not sure if it's worth the effort.
> >>
> >> Especially since we don't know for certain that DOM building takes
> >> most of the CPU. For example, It could very well be the gobject
> >> creation.
> >>
> > I did small test parsing ~3800 DIDL iitem snippets, the time
> > distribution in there looks like:
> > 10% g_object_unref
> > 14% g_object_new
> > 70% xmlRecoverMemory
>
> Awesome! Now we at least know which functions take the most CPU.
>
> However, I wonder if those percentages map to real scenarios. Any
> decent client will never parse that many DIDLs in a short amount of
> time. i-e it will only browse objects that are actually needed and
> even then, it will use the right filter to get only the properties
> that it needs. Usually that translates to what is visible to user at a
> particular time and neighbouring objects. Right?
Well, we are not looking at absolute numbers here. The relative numbers
given by Jens should be more or less representative for a real-world
usage scenario. It doesn't really matter if the client parses one DIDL
object or thousands.
I may find time later this week to benchmark our code. I'll let you know
about the results then.
Regards,
Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]