Nikolas Klauser
2bdd1357c8
[libc++] Optimize num_get integral functions ( #121795 )
...
```
---------------------------------------------------
Benchmark old new
---------------------------------------------------
BM_num_get<bool> 86.5 ns 32.3 ns
BM_num_get<long> 82.1 ns 30.3 ns
BM_num_get<long long> 85.2 ns 33.4 ns
BM_num_get<unsigned short> 85.3 ns 31.2 ns
BM_num_get<unsigned int> 84.2 ns 31.1 ns
BM_num_get<unsigned long> 83.6 ns 31.9 ns
BM_num_get<unsigned long long> 87.7 ns 31.5 ns
BM_num_get<float> 116 ns 114 ns
BM_num_get<double> 114 ns 114 ns
BM_num_get<long double> 113 ns 114 ns
BM_num_get<void*> 151 ns 144 ns
```
This patch applies multiple optimizations:
- Stages two and three of do_get are merged and a custom integer parser
has been implemented
This avoids allocations, removes the need for strto{,u}ll and avoids
__stage2_int_loop (avoiding extra writes to memory)
- std::find has been replaced with __atoms_offset, which uses vector
instructions to look for a character
Fixes #158100
Fixes #158102
2025-11-24 16:53:58 +01:00
..
2024-12-18 21:10:27 +01:00
2025-11-24 11:09:40 +01:00
2024-11-06 12:10:06 +01:00
2024-12-18 21:10:27 +01:00
2024-04-22 22:13:58 +02:00
2025-01-08 11:12:59 -05:00
2025-10-02 11:15:33 +02:00
2025-10-07 14:42:11 +02:00
2024-11-06 12:10:06 +01:00
2024-11-12 23:03:52 +01:00
2025-10-07 14:42:11 +02:00
2024-11-06 12:10:06 +01:00
2025-10-07 14:42:11 +02:00
2024-12-18 21:10:27 +01:00
2025-03-19 11:51:21 -04:00
2025-11-07 08:27:55 +01:00
2025-11-07 08:27:55 +01:00
2024-12-18 21:10:27 +01:00
2024-12-18 21:10:27 +01:00
2024-09-12 21:18:43 +02:00
2024-09-12 21:18:43 +02:00
2025-10-09 17:57:59 +08:00
2025-07-25 16:27:34 +02:00
2025-11-07 08:27:55 +01:00
2025-11-07 08:27:55 +01:00
2025-10-28 22:22:26 +08:00
2025-10-20 19:37:33 +08:00
2024-01-25 15:48:46 -05:00
2024-01-25 15:48:46 -05:00
2024-01-25 15:48:46 -05:00
2024-01-25 15:48:46 -05:00
2024-01-25 15:48:46 -05:00
2024-12-18 21:10:27 +01:00
2025-03-19 07:42:23 +08:00
2024-09-12 21:18:43 +02:00
2024-12-18 21:10:27 +01:00
2024-09-12 21:18:43 +02:00
2025-10-07 14:42:11 +02:00
2024-12-18 21:10:27 +01:00
2024-12-18 21:10:27 +01:00
2025-01-08 11:12:59 -05:00
2025-10-07 14:42:11 +02:00
2024-11-06 10:39:19 +01:00
2024-12-18 21:10:27 +01:00
2025-10-07 14:42:11 +02:00
2025-01-20 18:00:15 +01:00
2024-09-12 21:18:43 +02:00
2024-09-12 21:18:43 +02:00
2024-12-18 21:10:27 +01:00
2025-03-27 09:05:37 -04:00
2024-09-12 21:18:43 +02:00
2024-09-16 15:06:20 -04:00
2024-09-12 21:18:43 +02:00
2025-10-07 14:42:11 +02:00
2025-10-07 14:42:11 +02:00
2025-10-07 14:42:11 +02:00
2024-01-25 15:48:46 -05:00
2025-11-24 11:09:40 +01:00
2024-01-25 15:48:46 -05:00
2025-04-05 13:46:11 +02:00
2025-09-08 12:00:04 +02:00
2025-09-08 12:00:04 +02:00
2024-09-16 15:06:20 -04:00
2024-03-18 08:29:44 +01:00
2024-01-25 15:48:46 -05:00
2025-10-07 14:42:11 +02:00
2024-03-18 08:29:44 +01:00
2025-10-07 14:42:11 +02:00
2024-11-06 12:10:06 +01:00
2024-11-06 12:10:06 +01:00
2024-11-06 12:10:06 +01:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-11-06 12:10:06 +01:00
2024-11-12 23:03:52 +01:00
2024-11-12 23:03:52 +01:00
2024-11-06 12:10:06 +01:00
2024-08-01 08:54:06 -04:00
2024-09-16 15:06:20 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-11-06 12:10:06 +01:00
2025-10-17 07:41:24 +08:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-09-16 15:06:20 -04:00
2024-08-01 08:54:06 -04:00
2024-09-30 08:30:16 -04:00
2025-06-18 12:22:47 -04:00
2025-06-18 12:22:47 -04:00
2025-10-28 22:22:26 +08:00
2024-09-16 15:06:20 -04:00
2024-08-01 08:54:06 -04:00
2025-03-20 01:59:32 +08:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2025-02-21 07:59:46 -05:00
2024-08-04 10:02:43 +02:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2025-03-27 09:05:37 -04:00
2025-03-27 09:05:37 -04:00
2024-08-01 08:54:06 -04:00
2025-03-27 09:05:37 -04:00
2025-03-27 09:05:37 -04:00
2024-08-01 08:54:06 -04:00
2024-10-30 11:51:55 +01:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-09-16 15:06:20 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-11-12 23:03:52 +01:00
2024-08-01 08:54:06 -04:00
2024-11-12 23:03:52 +01:00
2024-11-12 23:03:52 +01:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2025-03-06 09:23:55 +08:00
2025-03-07 01:27:48 +08:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2025-01-08 11:12:59 -05:00
2024-08-01 08:54:06 -04:00
2024-08-01 08:54:06 -04:00
2024-09-12 21:18:43 +02:00
2024-09-12 21:18:43 +02:00
2024-01-25 15:48:46 -05:00
2025-03-13 14:07:23 -04:00
2024-09-16 15:06:20 -04:00
2024-09-16 15:06:20 -04:00
2024-11-12 23:03:52 +01:00
2024-09-16 15:06:20 -04:00
2024-11-12 23:03:52 +01:00
2024-11-12 23:03:52 +01:00
2024-01-25 15:48:46 -05:00
2024-01-25 15:48:46 -05:00
2025-05-28 12:04:51 -04:00
2025-10-07 14:42:11 +02:00
2025-11-24 16:53:58 +01:00
2024-03-18 08:29:44 +01:00
2025-08-28 18:07:59 -04:00
2025-03-04 09:23:29 +08:00
2025-10-07 14:42:11 +02:00
2025-03-04 17:15:36 -05:00
2025-01-08 11:12:59 -05:00
2024-09-16 15:06:20 -04:00
2024-01-25 15:48:46 -05:00
2024-11-06 12:10:06 +01:00
2025-01-08 11:12:59 -05:00
2024-01-25 15:48:46 -05:00
2024-09-16 15:06:20 -04:00