Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

tests: Stop hardcoding the number of cores #22

Closed
pmav99 opened this issue Nov 2, 2020 · 1 comment
Closed

tests: Stop hardcoding the number of cores #22

pmav99 opened this issue Nov 2, 2020 · 1 comment

Comments

@pmav99
Copy link
Contributor

pmav99 commented Nov 2, 2020

Hardcoding the number of cores is suboptimal. It makes it difficult to develop on low end machines (up to 4 cores) and is wasting time on higher end machines (4+ cores are available).

A reasonable default is to use the maximum number of cores minus one or two. E.g.

import multiprocessing

NCORES = max(1, multiprocessing.cpu_count() - 1)

Alternatively, the number of cores could be specified via an ENV variable, but not sure that something like this is that much useful at the moment.

The files that need to be updated can be found with:

ag --python ncores
@brey
Copy link
Owner

brey commented Feb 15, 2021

Done with 01b817a

@brey brey closed this as completed Feb 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants