[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

That would not change that slot space is at a premium and that we prefer to use 
that space for high payoff optimizations.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 29ea68bd1dcf30842c2ed908a6d815bc1d90f484 by Raymond Hettinger in 
branch 'main':
Revert "bpo-46131: add fastpath for PyFloat_Check() (GH-30200)" (GH-30208)
https://github.com/python/cpython/commit/29ea68bd1dcf30842c2ed908a6d815bc1d90f484


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread mattip


mattip  added the comment:

What do ya'all think of widen the flags field to int64_t so that there is more 
room for optimizations like this?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +28429
pull_request: https://github.com/python/cpython/pull/30208

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 2ef06d412531d1163dbc72877c88aedf3ed82a25 by Matti Picus in branch 
'main':
bpo-46131: add fastpath for PyFloat_Check() (#30200)
https://github.com/python/cpython/commit/2ef06d412531d1163dbc72877c88aedf3ed82a25


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion, but I also concur with Serhiy.

--
nosy: +rhettinger
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is because PyFloat_Check() and PyComplex_Check() are rarely used in 
comparison with checks for integers, strings, etc. The flags space is limited, 
so it is better to use it for something more important.

There were reasons for not adding such flags at first place and I think that 
they are still valid.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread mattip


Change by mattip :


--
keywords: +patch
pull_requests: +28421
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30200

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread mattip


mattip  added the comment:

"complex" is also missing a fast path

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46131] Add PyType_FastSubclass for float

2021-12-19 Thread mattip


New submission from mattip :

The basic classes int, dict, list, tuple ... all have a fast path for 
Py_*Check(obj):

#define PyLong_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)


except for float. I propose to add a Py_TPFLAGS_FLOAT_SUBCLASS enum and use it 
to implement PyType_FastSubclass for float.

--
components: C API
messages: 408890
nosy: mattip
priority: normal
severity: normal
status: open
title: Add PyType_FastSubclass for float

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com