Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 8 Apr 2015 11:33:16 -0400
From: John Mudd <johnbmudd@...il.com>
To: musl <musl@...ts.openwall.com>
Cc: John Mudd <johnbmudd@...il.com>
Subject: musl perf, 20% slower than native build?

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
$

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.