sublee / trueskill

An implementation of the TrueSkill rating system for Python
https://trueskill.org/
Other
742 stars 112 forks source link

Performance? #26

Open michalrus opened 6 years ago

michalrus commented 6 years ago

Hello!

Thank you for this wonderful piece of code. =)

Have you tried tuning the performance?

E.g. for 10,000 random matches (each of max. 5 teams of max. 10 members each) it consistently takes:

… on 4 cores (and 4 parallel python3 processes).

michalrus commented 6 years ago

There’s also some C++ version that doesn’t do teams but is ~200× faster → https://github.com/JesseBuesking/trueskill#benchmark .

bernd-wechner commented 6 years ago

At a random guess I'd say you're just looking at the difference between Python and C++ in terms of performance. But I'm guessing if you were keen you could profile both of them and look for the bottlenecks, try doing a flame graph, very informative:

http://www.brendangregg.com/flamegraphs.html

michalrus commented 6 years ago

Very cool, I’ll try that! Thanks. =)

sublee commented 6 years ago

When I implemented it, performance was not one of the goals. The goal is to implement the TrueSkill algorithm with clean code for ease of understanding.

If you need better performance, another implementation (perhaps, with another language) will be helpful rather than this project.