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
Loading
Please sign in to comment