I'm working with python on raspberry pi. I'm using complementary filter to get better values from gyroscope, but it eats too much raspberry's power - it's about 70%. I thought I could increase performance by reducing floating point precision. Now, results have about 12 decimal places, it's way more than I need. Is there any way to set maximum precision? Just rounding the number doesn't meet my needs, since it's just another calculation. Thanks!
Edit: I have tried to use Decimal module and with precision set to 6 it was nearly 6 times slower than float! Is there any other way to work with fixed-point numbers than Decimal (it looks to be created for higher precision than for performance)
It may be that you have the wrong end of the stick. 
The data flow form a gyroscope is rather slow, so you should have ample time to filter it with any reasonable filter. Even a Kalman filter should be usable (though probably unnecessary). How often do you sample the gyroscope and accelerometer data? Reasonable maximum values are few hundred Hertz, not more.
The complementary filter for accelerometer and gyroscope measurement is very lightweight, and it by itself should consume very little processing power. It can be implemented on a slow 8-bit processor, so Raspberry is way too fast for it.
Depending on what you do with the complementary filter, the filter itself needs a few floating point operations. If you calculate arcus tangents or equivalent functions, that'll require hundreds of FLOPs. If you do that at a rate of 1 kHz, you'll consume maybe a few hundred kFLOPS (FLoating-point OPerations per Second). The FP throughput of a RPi is approximately 100 MLFOPS, so there is a lot of margin.
Reducing the FP precision will thus not help significantly, the problem is elsewhere. Maybe if you show a bit more of your code, it could be determined where the problem is!
Lower the floating-point precision in python to increase performance