Ville Vesilehto
70c8746ced
perf(topdown): optimize json.remove and .filter ( #8193 )
...
Optimize `json.remove` and `json.filter` to reduce memory
allocations and copy overhead.
Changes:
- Pre-allocate result collections in `jsonRemove` using the
source size as an upper bound.
- Refactor `jsonRemove` for Arrays to accumulate elements in
a pre-allocated Go slice before creating the AST Array,
avoiding intermediate allocations.
- Pre-allocate the root object in `pathsToObject` used by both
built-ins.
- Optimize `ast.Object.Filter` (used by `json.filter`) for
Arrays to avoid incremental `Append` allocations.
Signed-off-by: Ville Vesilehto <ville@vesilehto.fi >
2026-01-08 19:52:57 +01:00
..
2025-11-18 16:02:12 +01:00
2025-08-24 09:02:09 +02:00
2025-12-25 22:40:19 +01:00
2025-08-24 09:02:09 +02:00
2024-12-12 15:09:03 +01:00
2024-12-12 15:27:34 +01:00
2025-10-10 17:51:02 +02:00
2025-10-02 14:54:14 +02:00
2025-06-23 11:40:00 +02:00
2026-01-06 14:24:14 -06:00
2025-05-28 23:19:31 +02:00
2025-01-31 20:24:05 +01:00
2025-11-27 10:41:37 +01:00
2024-12-12 15:09:03 +01:00
2025-08-24 09:02:09 +02:00
2024-12-12 15:09:03 +01:00
2025-01-30 09:57:27 +01:00
2024-12-12 15:09:03 +01:00
2025-05-15 15:34:44 +02:00
2024-12-12 15:09:03 +01:00
2025-06-23 11:40:00 +02:00
2025-08-24 09:02:09 +02:00
2025-06-23 11:40:00 +02:00
2025-06-23 11:40:00 +02:00
2025-10-10 17:51:02 +02:00
2025-11-18 16:02:12 +01:00
2024-12-12 15:09:03 +01:00
2025-11-18 16:02:12 +01:00
2025-11-18 16:02:12 +01:00
2026-01-08 10:14:53 +01:00
2026-01-08 10:14:53 +01:00
2025-12-16 11:47:04 +01:00
2025-11-21 10:52:22 +01:00
2025-05-12 13:57:48 +02:00
2026-01-08 13:58:19 +01:00
2025-10-10 17:51:02 +02:00
2025-08-24 09:02:09 +02:00
2025-06-23 11:40:00 +02:00
2025-10-15 12:47:08 +02:00
2025-11-10 10:06:21 +01:00
2025-09-03 15:21:30 -05:00
2024-12-12 15:09:03 +01:00
2024-12-12 15:09:03 +01:00
2025-05-12 13:57:48 +02:00
2025-11-18 16:02:12 +01:00
2025-11-05 16:55:19 +01:00
2025-05-12 13:57:48 +02:00
2025-01-31 20:24:05 +01:00
2024-12-12 15:09:03 +01:00
2026-01-08 19:52:57 +01:00
2024-12-12 15:09:03 +01:00
2026-01-08 19:52:57 +01:00
2025-08-24 09:02:09 +02:00
2025-06-23 11:40:00 +02:00
2025-08-24 09:02:09 +02:00
2024-12-12 15:09:03 +01:00
2025-10-10 17:51:02 +02:00
2025-08-24 09:02:09 +02:00
2025-09-08 13:21:48 +00:00
2025-10-10 17:51:02 +02:00
2024-12-12 15:09:03 +01:00
2026-01-07 23:24:09 +01:00
2025-02-24 16:28:41 +01:00
2025-02-24 16:28:41 +01:00
2024-12-12 15:09:03 +01:00
2025-12-16 11:47:04 +01:00
2025-12-18 11:04:18 +00:00
2024-12-18 20:59:15 +01:00
2025-08-24 09:02:09 +02:00
2025-12-18 11:04:18 +00:00
2024-12-12 15:09:03 +01:00
2025-10-10 17:51:02 +02:00
2025-01-31 20:24:05 +01:00
2025-01-30 09:57:27 +01:00
2025-08-24 09:02:09 +02:00
2026-01-08 13:58:19 +01:00
2025-05-15 15:34:44 +02:00
2025-08-24 09:02:09 +02:00
2025-06-23 11:40:00 +02:00
2024-12-12 15:09:03 +01:00
2025-05-20 23:12:13 +02:00
2025-11-04 09:09:50 +01:00
2025-10-10 17:51:02 +02:00
2024-12-12 15:09:03 +01:00
2026-01-08 10:24:13 +01:00
2025-12-02 16:56:58 +01:00
2025-10-10 17:51:02 +02:00
2025-12-01 10:46:05 +01:00
2025-06-23 11:40:00 +02:00
2025-12-18 11:04:18 +00:00
2025-12-18 11:04:18 +00:00
2025-05-12 13:57:48 +02:00
2025-02-17 22:08:27 +01:00
2025-08-24 09:02:09 +02:00
2025-06-23 11:40:00 +02:00
2025-08-24 09:02:09 +02:00
2025-10-10 17:51:02 +02:00
2025-12-25 22:40:19 +01:00
2025-12-18 11:04:18 +00:00
2025-10-10 17:51:02 +02:00
2025-09-16 09:24:16 +02:00
2025-11-21 08:42:43 +01:00
2025-08-24 09:02:09 +02:00
2025-11-17 11:08:39 +01:00
2025-06-23 11:40:00 +02:00
2025-06-23 11:40:00 +02:00
2025-08-24 09:02:09 +02:00
2025-05-28 23:19:31 +02:00
2025-06-23 11:40:00 +02:00