Checking whether the object is a numpy array checking is pretty expensive, so we only want to do it when the object is not trivially a float. This makes appending to a repeated field of float ~3x faster in a common case: ``` _bench_append, 1000000, 284.1 _bench_extend, 1000000, 209.0 _bench_assign, 1000000, 175.8 _bench_pybind11, 1000000, 3.7 ``` ``` _bench_append, 1000000, 128.4 _bench_extend, 1000000, 67.1 _bench_assign, 1000000, 57.2 _bench_pybind11, 1000000, 3.5 ``` PiperOrigin-RevId: 707811151pull/19711/head
parent
0d47a29c45
commit
9e44913d43
1 changed files with 3 additions and 3 deletions
Loading…
Reference in new issue