Using a precompiled gRPC plugin for Python in Bazel

This repository is an example of how to use a precompiled gRPC protobuf plugin for compiling Python gRPC stubs.

Why do this?

  • Faster cold start builds (~29X speed-up, see below)
    • Avoid C++ compilation of dependencies when not editing any C++ files
Typical compile (with C++ compilation), 99s Precompiled Binary, 3.3s
typical compilation compilation using precompiled binary

Approach

Alternative approaches

  • Request for grpc to publish the compiled plugin and use it once it exists: grpc/grpc#38078