FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add multi-threaded compilation and evaluation tests and resolve compilation deadlock in CEL Python. by copybara-service[bot] · Pull Request #103 · cel-expr/cel-python · GitHub

Add multi-threaded compilation and evaluation tests and resolve compilation deadlock in CEL Python. - #103

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_968187521
Aug 25, 2026
Merged

Add multi-threaded compilation and evaluation tests and resolve compilation deadlock in CEL Python.#103
copybara-service[bot] merged 1 commit into
mainfrom
test_968187521

Conversation

copybara-service Bot commented Aug 21, 2026
edited
Loading

Copy link
Copy Markdown

Add multi-threaded compilation and evaluation tests and resolve compilation deadlock in CEL Python.

This change adds cel_parallel_test.py to benchmark and validate compiling and
evaluating a diverse set of CEL expressions concurrently across multiple worker
threads using concurrent.futures.ThreadPoolExecutor as well as sequentially.

In addition, this resolves an AB-BA deadlock between the Python GIL and Protobuf
DescriptorPool C++ mutex during concurrent compilation by releasing the GIL
in PyCelEnv::Compile and acquiring the GIL via py::gil_scoped_acquire on-demand
in PyDescriptorDatabase callbacks, while protecting PyCelEnvInternal with a mutex.

Test duration metrics:

  • Multi-threaded compilation (1,000 iterations): ~248 ms
  • Sequential compilation (1,000 iterations): ~394 ms
  • Multi-threaded evaluation (10,000 iterations): ~782 ms
  • Sequential evaluation (10,000 iterations): ~434 ms

copybara-service Bot changed the title Add multi-threaded evaluation and compilation tests for CEL Python. Add multi-threaded compilation and evaluation tests and resolve compilation deadlock in CEL Python. Aug 21, 2026
…lation deadlock in CEL Python.

This change adds cel_parallel_test.py to benchmark and validate compiling and
evaluating a diverse set of CEL expressions concurrently across multiple worker
threads using concurrent.futures.ThreadPoolExecutor as well as sequentially.

In addition, this resolves an AB-BA deadlock between the Python GIL and Protobuf
DescriptorPool C++ mutex during concurrent compilation by releasing the GIL
in PyCelEnv::Compile and acquiring the GIL via py::gil_scoped_acquire on-demand
in PyDescriptorDatabase callbacks, while protecting PyCelEnvInternal with a mutex.

Test duration metrics:
- Multi-threaded compilation (1,000 iterations): ~248 ms
- Sequential compilation (1,000 iterations): ~394 ms
- Multi-threaded evaluation (10,000 iterations): ~782 ms
- Sequential evaluation (10,000 iterations): ~434 ms

PiperOrigin-RevId: 970277102
copybara-service Bot merged commit 6041cbb into main Aug 25, 2026
1 check passed
copybara-service Bot deleted the test_968187521 branch August 25, 2026 04:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

1 participant


Back | FazBrowse Home | New Git URL