Commit 72a0e076 authored by Derek Murray's avatar Derek Murray Committed by TensorFlower Gardener
Browse files

Add fast path for `OpRegistry::LookUp()` that avoids acquiring an exclusive lock.

The registry is read-mostly, and writes are rare (startup + any calls to `tf.load_op_library()`), so in the common case it is sufficient can acquire a shared lock for a successful lookup.

This change reduces the overhead of `MapDatasetOp::MakeDataset()` inside a parallel interleave, and any other case where multiple threads might concurrently attempt to instantiate a function or build a subgraph.

PiperOrigin-RevId: 234169932
parent 896ad105
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment