python-vote-core icon indicating copy to clipboard operation
python-vote-core copied to clipboard

Optimizations / SMP

Open beltiras opened this issue 9 years ago • 5 comments

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.

beltiras avatar Aug 13 '16 14:08 beltiras

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!

bradbeattie avatar Aug 13 '16 14:08 bradbeattie

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

beltiras avatar Aug 13 '16 23:08 beltiras

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. :)

bradbeattie avatar Aug 14 '16 00:08 bradbeattie

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

beltiras avatar Aug 14 '16 10:08 beltiras

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

beltiras avatar Aug 15 '16 08:08 beltiras