mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Ed Schouten <ed@nuxi.nl>
To: musl@lists.openwall.com, Ed Schouten <ed@nuxi.nl>
Subject: Re: Re: AVL tree: storing balances instead of heights
Date: Thu, 10 Dec 2015 14:12:08 +0100	[thread overview]
Message-ID: <CABh_MKnwBHOjguKuxvuNCXcZVOuo=DmWEuJRsQCkjrcxCzkbfw@mail.gmail.com> (raw)
In-Reply-To: <20151210121449.GC23362@port70.net>

Hi Szabolcs,

2015-12-10 13:14 GMT+01:00 Szabolcs Nagy <nsz@port70.net>:
> can you add code size column as well?
> (sum of size of x86_64 pic .text+.data+.bss)

I've added text sizes for all of the functions, building them using
these compilers:

GCC: (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Clang: 3.7.0-2ubuntu1 (tags/RELEASE_370/final) (based on LLVM 3.7.0)

None of the functions use any data/bss, so I've only added the text
sizes. As some implementations have some code reuse between tsearch()
and tdelete(), I've done both separate and combined builds of these
two functions.

The sizes of the glibc implementation is an estimate, as I didn't
build that one manually.

> i assume freebsd does not balance the tree so it timeouts
> (which also shows why this api is not useful in practice)

Exactly.

> glibc uses red-black trees which do less balancing operations
> so insert/delete may be faster, but lookup is slightly slower.
> (but it seems it does more comparisions and that can be slow)

Yes. Comparisons are rather expensive (one callback per comparison),
so we'd better optimize for a tree that is as flat as possible.

> i assume the musl code there already has the tdelete balancing
> patch applied and it is compiled with -Os.

It was the latest version in Git, using -O2.

> performance also depends on the allocator since insert/delete
> has to malloc/free (yet another issue with the api) musl's
> allocator is i think still better for realtime systems than
> the jemalloc used in cloudlibc, but it will have worse average
> performance in benchmarks like this.

Yes. All of the tests were run on Linux, using glibc. Only the
tsearch()/tdelete() implementations are different between tests. They
all use glibc's standard malloc().

-- 
Ed Schouten <ed@nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717


  reply	other threads:[~2015-12-10 13:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABh_MKm1Ow5_dc4ENJM-fAqWc+uPPZgftRdSDxPJiPXZAfZ+FQ@mail.gmail.com>
2015-12-07 13:03 ` Szabolcs Nagy
2015-12-07 13:19   ` Ed Schouten
2015-12-07 13:22     ` Ed Schouten
2015-12-07 14:46     ` Szabolcs Nagy
2015-12-10  9:21       ` Ed Schouten
2015-12-10 12:14         ` Szabolcs Nagy
2015-12-10 13:12           ` Ed Schouten [this message]
2015-12-10 13:43             ` Szabolcs Nagy
2015-12-20 21:43               ` Szabolcs Nagy
2015-12-21  1:28                 ` Szabolcs Nagy

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='CABh_MKnwBHOjguKuxvuNCXcZVOuo=DmWEuJRsQCkjrcxCzkbfw@mail.gmail.com' \
    --to=ed@nuxi.nl \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).