Any task, even trivial, takes a lot of time using billiard

Open
#321 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start by running the supplied test.py with both billiard and Python's multiprocessing library, recording the elapsed times shown in the issue. Compare the Pool setup, map call, close, and join behavior in the two runs. Done means identifying the cause of billiard's slowdown and confirming that the example completes with comparable timing.

Written by the indexing model from the issue text.

Description

Any task, even trivial, takes a lot of time using billiard. The same test works fine using the multiprocessing library.
test.py

import billiard as mp

def func(a):
  return a


y= list(range(10))

pool = mp.Pool(2)
s = sum(pool.map(func, y))
pool.close()
pool.join()

print (s)

run the script

time python3 test.py 
45

real	0m31.168s
user	0m0.104s
sys	0m0.023s

if you replace billiard with multiprocessing it works fine:

time python3 test.py 
45

real	0m0.185s
user	0m0.087s
sys	0m0.007s
Dominant language
Python
Stars
436
Forks
273
Avg merge
4d 19h
Merged PRs (30d)
5

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from celery/billiard

All issues in celery/billiard

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.