diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-05-26 15:17:33 -0500 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2020-05-31 12:32:31 -0500 |
commit | ebb4e48f83bbbc6cea3c5781a838b032e120663d (patch) | |
tree | 66f2e3e4a2a60db2522744402e79e8bb4bb08c6e /numpy/array_api/_array_object.py | |
parent | 426b3cac7932289f24be7dc6dba6197a4d65740b (diff) | |
download | numpy-ebb4e48f83bbbc6cea3c5781a838b032e120663d.tar.gz |
ENH: Hardcode buffer handling for simple scalars
For most scalars (except void ones) exposing the buffer interface
is trivial and does not require any fancy "format" handling.
Except for unicode, their buffer interface is also static and thus
can simply be hardcoded.
The main advantage, is that currently the buffer interface uses
a global dictionary to store these buffers and thus requires
probing that dictionary for every single scalar dealloc. This
results in an overhead of about 30% for simple operations (such
as slicing and simple math).
Diffstat (limited to 'numpy/array_api/_array_object.py')
0 files changed, 0 insertions, 0 deletions