[Csnd] Linux - slower performance due math lib in glibc 2.16/2.17
Date | 2013-12-17 15:57 |
From | Tarmo Johannes |
Subject | [Csnd] Linux - slower performance due math lib in glibc 2.16/2.17 |
Hi,
sharing an experience: I was experimenting myself mad, why a csd that I wrote about a year ago could not run properly any more. It used a lot of pvs opcodes and now I got a lot of xruns. The computer was the same. During developing the csd I used openSuse 12.1, now 12.3.
Finally I found out that the problem was in the math library (libm.so) of glibc package. Opensuse 12.1 uses glibc 2.14, 12.2 - 2.15, 12.3 - 2.17, 13.1 - 2.18. There were some changes in the math lib in glibc 2.16 (also present in 2.18) that made sinus/cosinus computation slower in some cases. Since I guess real time FFT analysis uses a myriad of sin/cos operations, the result was considerably slower when you use many pvs instruments on the same time. It is fixed now in glibc 2-18.
I don't know if it is problem also in other linux distros, but if you suffer from that, I got the situation much better the following way: since glibc is so central library for the whole system, you cannot easily upgrade or downgrade it. I downloaded the source code of glibc (version 2.15), built it, copied the math lib libm.so to the system libraries folder (/lib64 in my case) and changed the symlink so that limb.so.6 pointed to my libm library. It solved the problem and have not felt any drawbacks so far.
This has been the only case where I have noted that the system was slower, neither in normal work nor using Csound, but in some cases it can be crucial.
Hope it can help others, too, in similar situation. best! tarmo |
Date | 2013-12-17 16:49 |
From | jpff@cs.bath.ac.uk |
Subject | [Csnd] Re: |
Attachments | None |