I know some parts of twister-core might benefit from optimization, but as a follower of Knuth’s optimization mantra i usually try to favor consistency over “premature optimization”.
So it happened that twister started performing very slowly recently. I noticed it and others have noticed it as well. Performance on low-end Android phones was so bad to the point of being unusable.
twisterd went to it’s first profiling session this afternoon. After a few attempts to use kernel perf and oprofile tools, I couldn’t get good call graphs to show me the hot spots (just knowing that CPU is spent inside OpenSSL doesn’t help at all). Finally it was Google’s gperftools that really gave me some useful information.
It turns that an almost one-liner patch is responsible for the most drastic CPU usage reduction in twister ever. Android devices may now run longer on battery. And since this part of the code competes with DHT processing, the quicker response times from other nodes may actually improve the twister’s interactivity as a whole. I’m optimistic. Lets update all the clients and see what happens!
APK and Windows precompiled are already updated to version 0.9.13. Have fun!