netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Elise Lennion <elise.lennion@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft 1/2] src: sort set elements in netlink_get_setelems()
Date: Tue, 10 Jan 2017 22:11:00 +0100	[thread overview]
Message-ID: <20170110211100.GA16808@salvia> (raw)
In-Reply-To: <20170106214331.GA3265@lennorien.com>

On Fri, Jan 06, 2017 at 07:43:32PM -0200, Elise Lennion wrote:
> So users can better track their ruleset via git.
>
> Without sorting, the elements can be listed in a different order
> every time the set is created, generating unnecessary git changes.
>
> Mergesort is used. Doesn't sort sets with 'flags interval' set on.

Applied, thanks Elise! I'm appending this to your description BTW:

Currently these interval set elements are dumped in order. We'll
likely get new representations soon that may not guarantee this
anymore, so let's revisit this later in case we need it.

Without this patch, nft list ruleset with a set containing 40000
elements takes on my laptop:

        real    0m2.742s
        user    0m0.112s
        sys     0m0.280s

With this patch:

        real    0m2.846s
        user    0m0.180s
        sys     0m0.284s

Difference is small, so don't get nft more complicated with yet
another getopt() option, enable this by default.

      reply	other threads:[~2017-01-10 21:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06 21:43 [PATCH nft 1/2] src: sort set elements in netlink_get_setelems() Elise Lennion
2017-01-10 21:11 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170110211100.GA16808@salvia \
    --to=pablo@netfilter.org \
    --cc=elise.lennion@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).