bradbeattie / python-vote-core

Python libraries for various electoral methods
http://modernballots.com
Other
140 stars 36 forks source link

Optimizations / SMP #26

Open beltiras opened 8 years ago

beltiras commented 8 years ago

I just observed an election using this library where the calculation took about an hour to run. We had 105 candidates and rougly 1000 ballots. I'm willing to start to dig into the code to find ways of optimizing. I have experience with using Celery to fork workloads. Is anyone else following the project that has started something similar? Calling for collaboration.

bradbeattie commented 8 years ago

Which algorithm were you using? I'm aware of performance issues with SchulzeSTV and SchulzePR. If so, it's not the number of ballots that's causing the slowdown; It's the number of candidates.

My planned first steps were conversion into Python3 and looking at optimization from there. If I recall correctly, both stand to gain a fair amount from parallelization. Pull requests welcome!

beltiras commented 8 years ago

Understood. I didn't want to do duplication of effort, didn't see a roadmap. Does the Celery plan appeal to you?

bradbeattie commented 8 years ago

I'd far prefer not to have external dependencies if at all possible, but if you want to fork a celery branch and work on that, I have no complains. :)

beltiras commented 8 years ago

Any SMP at all will require at least one dependency. I'd rather use a library you are comfortable with.

beltiras commented 8 years ago

The algorithm was SchulzePR btw, to answer that question. Run took around 40 minutes.