[systemd-devel] [PATCH 1/1] sd-rtnl: Introduce container parsing
Tom Gundersen
teg at jklm.no
Tue Mar 25 07:28:40 PDT 2014
On Tue, Mar 25, 2014 at 3:16 AM, Susant Sahani <susant at redhat.com> wrote:
>> I now pushed an alternative patch. Could you have a look if it makes
>> sense to you?
>
> If am not wrong *sd_rtnl_message_enter_container* trying to parse
> (rtnl_message_parse)
> every time a attribute is requested which is inside nested attribute.
Well, usually one would only enter a container once, and then read all
one wants from it, rather than entering/exiting for each attribute, so
in practice every container should only be parsed once.
> It
> would be better to parse only once and keep
> the data structures ready for reading so that the parsing does not happen
> each time a attribute is requested. More
> like from receiving side from kernel should have some intelligence to know
> what context it's in.
If there is a usecase where the current parser turns out to be
inefficient, I'd be happy to take a patch to optimize it by doing all
the parsing up front (not sure it is worth it though).
-t
More information about the systemd-devel
mailing list