Scott Wolchok
3262000195
Add fast_type_map, use it authoritatively for local types and as a hint for global types (ABI breaking) ( #5842 )
...
* Add fast_type_map, use it authoritatively for local types and as a hint for global types
nanobind has a similar two-level lookup strategy, added and explained
by
b515b1f7f2
In this PR I've ported this approach to pybind11. To avoid an ABI
break, I've kept the fast maps to the `local_internals`. I think this
should be safe because any particular module should see its
`local_internals` reset at least as often as the global `internals`,
and misses in the fast "hint" map for global types fall back to the
global `internals`.
Performance seems to have improved. Using my patched fork of
pybind11_benchmark
(https://github.com/swolchok/pybind11_benchmark/tree/benchmark-updates ,
specifically commit hash b6613d12607104d547b1c10a8145d1b3e9937266), I
run bench.py and observe the MyInt case. Each time, I do 3 runs and
just report all 3.
master, Mac: 75.9, 76.9, 75.3 nsec/loop
this PR, Mac: 73.8, 73.8, 73.6 nsec/loop
master, Linux box: 188, 187, 188 nsec/loop
this PR, Linux box: 164, 165, 164 nsec/loop
Note that the "real" percentage improvement is larger than implied by the
above because master does not yet include #5824 .
* simplify unsafe_reset_local_internals in test
* pre-implement PYBIND11_INTERNALS_VERSION 12
* use PYBIND11_INTERNALS_VERSION 12 on Python 3.14 per suggestion
* Implement reviewer comments: revert PY_VERSION_HEX change, fix REVIEW comment, add two-level lookup comments. ci.yml coming separately
* Use the inplace build to smoke test ABI bump?
* [skip ci] Remove "smoke" from comment. This is full testing, just only on a few platforms.
---------
Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com >
2025-10-05 11:07:25 -07:00
..
2025-09-19 13:44:40 -07:00
2024-06-22 00:55:00 -04:00
2025-06-17 12:14:50 -07:00
2025-09-19 13:44:40 -07:00
2025-09-08 15:47:24 -07:00
2025-10-05 11:07:25 -07:00
2025-09-19 13:44:40 -07:00
2025-07-11 15:36:38 -07:00
2024-11-18 14:39:59 -08:00
2024-06-18 13:54:38 -07:00
2024-06-18 13:54:38 -07:00
2024-09-17 09:47:20 -07:00
2024-06-18 13:54:38 -07:00
2025-09-03 09:06:41 -07:00
2024-11-10 12:17:35 -08:00
2024-09-13 00:18:29 -04:00
2024-09-13 00:18:29 -04:00
2024-08-22 00:27:50 -04:00
2025-06-02 16:08:40 -04:00
2025-06-02 16:08:40 -04:00
2022-02-10 12:17:07 -08:00
2024-06-18 13:54:38 -07:00
2025-05-16 21:58:43 -04:00
2024-11-07 09:32:09 -08:00
2025-08-06 22:32:45 -04:00
2025-05-22 01:37:57 -04:00
2025-05-15 14:39:23 -04:00
2022-02-10 12:17:07 -08:00
2024-09-03 10:51:21 -04:00
2025-09-08 15:47:24 -07:00
2025-05-31 23:47:20 -04:00
2025-03-18 07:56:34 -07:00
2025-03-18 07:56:34 -07:00
2024-10-07 14:12:04 -07:00
2024-10-25 08:28:15 -07:00
2025-08-04 05:00:33 -07:00
2025-05-19 11:54:31 -04:00
2022-02-10 12:17:07 -08:00
2024-06-22 00:55:00 -04:00
2025-09-08 15:47:24 -07:00
2025-02-16 11:01:41 -08:00
2025-05-25 10:54:05 -04:00
2025-07-11 15:36:38 -07:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-06-17 12:16:56 -07:00
2025-06-17 12:16:56 -07:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-10-01 11:21:47 -07:00
2025-10-01 11:21:47 -07:00
2025-09-08 15:47:24 -07:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-04-30 22:12:13 -07:00
2025-04-30 22:12:13 -07:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-04-30 22:12:13 -07:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-03-05 12:40:53 -08:00
2025-09-08 15:47:24 -07:00
2025-05-16 21:58:43 -04:00
2022-02-14 11:36:22 -08:00
2024-06-22 00:55:00 -04:00
2024-03-26 13:57:05 -04:00
2024-06-22 00:55:00 -04:00
2025-08-11 19:34:37 -07:00
2024-10-25 08:28:15 -07:00
2024-09-13 00:18:29 -04:00
2024-09-13 00:18:29 -04:00
2024-09-13 00:18:29 -04:00
2025-09-03 09:06:41 -07:00
2024-04-02 11:14:08 -04:00
2025-03-18 07:56:34 -07:00
2025-05-19 09:02:11 -04:00
2024-10-07 14:12:04 -07:00
2025-05-19 11:54:31 -04:00
2025-05-19 11:54:31 -04:00
2024-04-02 11:14:08 -04:00
2025-03-18 07:56:34 -07:00
2025-09-08 15:47:24 -07:00
2025-02-17 23:13:05 -08:00
2022-12-20 05:34:00 -08:00
2024-07-29 11:10:03 -07:00
2025-02-17 23:13:05 -08:00
2025-03-24 20:31:59 -07:00
2025-04-10 18:31:28 -04:00
2024-06-22 00:55:00 -04:00
2022-02-10 12:17:07 -08:00
2024-10-07 14:12:04 -07:00
2024-09-17 09:47:20 -07:00
2023-08-07 20:48:20 -07:00
2025-08-06 22:32:45 -04:00
2022-02-14 11:36:22 -08:00
2025-03-18 07:56:34 -07:00
2022-10-30 08:57:23 -07:00
2025-09-03 09:06:41 -07:00
2022-02-14 11:36:22 -08:00
2025-09-12 21:52:44 -07:00
2024-11-11 14:51:01 -08:00
2025-04-13 19:47:19 -07:00
2022-02-10 12:17:07 -08:00
2025-03-23 20:35:14 -07:00
2024-11-11 15:35:28 -08:00
2025-06-06 03:54:02 -04:00
2025-05-25 18:56:26 -04:00
2025-08-02 19:48:38 -07:00
2022-02-10 12:17:07 -08:00
2025-03-23 20:35:14 -07:00
2025-06-18 18:51:27 -04:00
2025-08-06 17:11:45 -04:00
2025-08-06 17:11:45 -04:00
2025-09-08 15:47:24 -07:00
2025-03-20 20:57:51 -07:00
2025-05-25 10:54:05 -04:00
2025-04-03 22:08:56 -04:00
2025-06-18 19:40:31 -04:00
2025-06-18 19:40:31 -04:00
2022-05-26 11:07:40 -04:00
2025-03-18 07:56:34 -07:00
2025-04-10 18:31:28 -04:00
2025-05-31 23:47:20 -04:00
2022-11-28 07:39:38 -08:00
2025-05-16 21:58:43 -04:00
2025-05-13 14:09:05 -04:00
2025-06-06 03:54:02 -04:00
2025-09-08 15:47:24 -07:00
2025-05-13 10:07:33 -04:00
2023-11-08 12:44:04 -08:00
2024-06-22 00:55:00 -04:00
2025-09-27 09:13:21 -07:00
2025-09-27 09:13:21 -07:00
2025-06-04 11:45:26 -04:00
2025-06-04 11:45:26 -04:00
2025-05-25 10:54:05 -04:00
2025-05-19 11:54:31 -04:00
2025-09-08 15:47:24 -07:00
2025-06-14 08:38:09 -07:00
2024-04-02 11:14:08 -04:00
2024-10-08 10:49:35 -07:00
2025-09-08 15:47:24 -07:00
2025-05-31 23:47:20 -04:00
2025-09-08 15:47:24 -07:00
2024-06-22 00:55:00 -04:00
2025-01-16 11:13:21 -08:00
2025-01-16 11:13:21 -08:00
2024-10-07 14:12:04 -07:00
2025-03-18 07:56:34 -07:00
2024-08-09 13:28:12 -07:00
2024-08-09 13:28:12 -07:00
2019-06-11 23:28:58 +02:00
2024-06-22 00:55:00 -04:00
2025-02-19 09:24:02 -08:00
2025-02-19 09:24:02 -08:00
2023-04-25 14:03:24 -07:00
2024-06-22 00:55:00 -04:00
2023-04-27 07:24:48 -07:00
2024-06-22 00:55:00 -04:00
2024-08-22 00:27:50 -04:00
2024-10-07 14:12:04 -07:00
2024-08-28 20:55:50 -07:00
2025-07-11 15:36:38 -07:00
2021-07-04 19:58:35 -04:00
2021-01-31 17:29:09 -05:00