Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel build support for ffibuilder.compile() #30

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

James-E-A
Copy link
Contributor

@James-E-A James-E-A commented Nov 3, 2023

Is there any real reason this wasn't added yet?

from cffi import FFI

ffibuilder = FFI()
...
# pass parallel=n to use that many threads,
# or parallel=True to automatically use os.cpu_count()
# https://github.com/python/cpython/blob/v3.5.0/Lib/distutils/command/build_ext.py#L449
# https://github.com/pypa/setuptools/blob/v66.1.0/setuptools/_distutils/command/build_ext.py#L470
ffibuilder.compile(verbose=True, parallel=True)

@arigo
Copy link
Contributor

arigo commented Nov 3, 2023

Looks reasonable to me. It's missing tests and documentation for all public methods with the new parallel keyword argument. (For tests I'd be happy with just making sure there is at least one test somewhere that gives some value to parallel, and one that doesn't, and both passes.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants