diff options
author | Antony Lee <anntzer.lee@gmail.com> | 2021-08-03 16:49:50 +0200 |
---|---|---|
committer | Antony Lee <anntzer.lee@gmail.com> | 2021-08-06 13:52:05 +0200 |
commit | c42f57b58fc2920a32a5be9b60dafba8b41c6411 (patch) | |
tree | 8e5f866702f31684aa133dba76afc46d79d7fc3b /numpy/array_api/_manipulation_functions.py | |
parent | 887766071724d27431b453b8270f299213b2d189 (diff) | |
download | numpy-c42f57b58fc2920a32a5be9b60dafba8b41c6411.tar.gz |
PERF: Special-case single-converter in loadtxt.
~5-13% speedup: `[*map(conv, items)]` (single converter, which is quite
common) is much faster than `[conv(val) for conv, val in zip(converters,
vals)]`.
`_loadtxt_floatconv` and `fencode` were lifted out so that every
"instance" of them is the same, allowing checking for whether there's
different converters in use (actually, it looks like two `floatconv`s
returned by two separate calls to `_getconv` have the same identity, but
we don't need to rely on that.
Diffstat (limited to 'numpy/array_api/_manipulation_functions.py')
0 files changed, 0 insertions, 0 deletions