mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Mudd <johnbmudd@gmail.com>
To: musl <musl@lists.openwall.com>
Cc: John Mudd <johnbmudd@gmail.com>
Subject: musl perf, 20% slower than native build?
Date: Wed, 8 Apr 2015 11:33:16 -0400	[thread overview]
Message-ID: <CAGDMk9F2kt-sK6s4nW4QV=ixqiFk=iGeivUK=WbgGbrUPAfW6w@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3350 bytes --]

On March 13 I raised a concern about performance, Subject "musl 14x slower?
". It now looks like most of that issue had to do with my application code.
But here's a more focused look at how musl compares to native build.
Granted this is crude, limited, but it looks like musl is 20% slower.

I built Python both native and with musl. It's not apples to apples, I
actually used a newer version of gcc to build musl 1.1.8 and musl Python.
This may and may not be an advantage fro the musl version. I also used -O3
when building musl and musl Python. I assume this should help the musl
version. The musl version also uses a newer version of Python. That may or
may not be helpful. I can redo with a more consistent builds if this is
worthwhile. Maybe you can suggest a straight C benchmark instead.

I ran a standard Python benchmark. The code is available here:
http://goo.gl/UyLDYC
I picked this at random. It is not all encompassing.

I've also never used "perf" before. Feel free to advise if this needs
improvement.


musl version:

$ python
Python 2.7.9 (default, Apr  2 2015, 15:16:16)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ perf stat python spitfire_bigtable.py
StringIO                                      507.98 ms
cStringIO                                     189.18 ms
list concat                                    61.59 ms

 Performance counter stats for
'/home/mudd/multicorn_ctree/spitfire_bigtable.py':

        810.537826 task-clock (msec)         #    0.971 CPUs utilized
               297 context-switches          #    0.366 K/sec
                11 cpu-migrations            #    0.014 K/sec
             5,977 page-faults               #    0.007 M/sec
     2,151,830,012 cycles                    #    2.655 GHz
    [50.64%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     3,106,074,350 instructions              #    1.44  insns per cycle
    [74.86%]
       677,389,217 branches                  #  835.728 M/sec
    [74.56%]
        13,710,101 branch-misses             #    2.02% of all branches
    [75.09%]

       0.834844640 seconds time elapsed
$



native:

$ python
Python 2.7.5 (default, Aug 19 2013, 15:23:53)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ perf stat ~/multicorn_ctree/spitfire_bigtable.py
StringIO                                      402.63 ms
cStringIO                                     132.62 ms
list concat                                    46.89 ms

 Performance counter stats for
'/home/mudd/multicorn_ctree/spitfire_bigtable.py':

        626.547364 task-clock (msec)         #    0.982 CPUs utilized
               169 context-switches          #    0.270 K/sec
                19 cpu-migrations            #    0.030 K/sec
             5,773 page-faults               #    0.009 M/sec
     1,663,247,805 cycles                    #    2.655 GHz
    [49.94%]
   <not supported> stalled-cycles-frontend
   <not supported> stalled-cycles-backend
     2,573,617,826 instructions              #    1.55  insns per cycle
    [75.03%]
       554,357,437 branches                  #  884.781 M/sec
    [75.49%]
        10,851,258 branch-misses             #    1.96% of all branches
    [74.83%]

       0.638252827 seconds time elapsed
$

[-- Attachment #2: Type: text/html, Size: 4438 bytes --]

             reply	other threads:[~2015-04-08 15:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 15:33 John Mudd [this message]
2015-04-08 15:58 ` Alexander Monakov
2015-04-08 16:05 ` Szabolcs Nagy
2015-04-08 19:10   ` John Mudd
2015-04-08 19:28     ` Daniel Cegiełka
2015-04-08 20:59       ` Paul Schutte
2015-04-09  6:50         ` Daniel Cegiełka
2015-04-09 17:28         ` Execinfo.h, backtrace is needed Jean-Marc Pigeon
2015-04-09 17:34           ` Rich Felker
2015-04-09 17:57             ` Alexander Monakov
2015-04-10 14:30               ` Jean-Marc Pigeon
2015-04-08 19:33     ` musl perf, 20% slower than native build? Alexander Monakov
2015-04-08 20:16       ` John Mudd
2015-04-08 20:24         ` John Mudd
2015-04-08 21:48           ` John Mudd

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='CAGDMk9F2kt-sK6s4nW4QV=ixqiFk=iGeivUK=WbgGbrUPAfW6w@mail.gmail.com' \
    --to=johnbmudd@gmail.com \
    --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).