Почему jemalloc занимает больше времени для выделения 4096 байт памяти, чем для другой МАЛЕНЬКОЙ памяти? ⇐ C++
Почему jemalloc занимает больше времени для выделения 4096 байт памяти, чем для другой МАЛЕНЬКОЙ памяти?
В процессе тестирования производительности jemalloc-5.2.0 по выделению памяти small_class было обнаружено, что время выделения памяти в 4096 байт было значительно выше, чем у другой памяти small_class. Есть ли какая-то специальная обработка выделения памяти размером 4096 байт в jemalloc? Или есть какая-то другая причина?
Результаты теста: [*]Используйте тест Google с многопоточным тестом (24 потока).
Работа на (32 процессорах X 3400 МГц) Кэш процессора: Данные L1 32 КиБ (x16) Инструкция L1 32 КиБ (x16) L2 унифицированный 256 КиБ (x16) L3 унифицированный 20480 КиБ (x2) Средняя нагрузка: 15,72, 14,21, 14,26 -------------------------------------------------- --------------------------------------- Тестовое время итераций процессора -------------------------------------------------- --------------------------------------- BM_SomeFunction/1792/iterations:500/threads:24 0,095 мс 2,12 мс 12000 BM_SomeFunction/1856/iterations:500/threads:24 0,175 мс 4,10 мс 12000 BM_SomeFunction/1920/iterations:500/threads:24 0,178 мс 4,13 мс 12000 BM_SomeFunction/1984/iterations:500/threads:24 0,177 мс 4,14 мс 12000 BM_SomeFunction/2048/iterations:500/threads:24 0,181 мс 4,18 мс 12000 BM_SomeFunction/2048/iterations:500/threads:24 0,177 мс 4,16 мс 12000 BM_SomeFunction/2176/iterations:500/threads:24 0,116 мс 2,67 мс 12000 BM_SomeFunction/2304/iterations:500/threads:24 0,113 мс 2,64 мс 12000 BM_SomeFunction/2432/iterations:500/threads:24 0,118 мс 2,75 мс 12000 BM_SomeFunction/2560/iterations:500/threads:24 0,113 мс 2,65 мс 12000 BM_SomeFunction/2560/iterations:500/threads:24 0,114 мс 2,68 мс 12000 BM_SomeFunction/2688/iterations:500/threads:24 0,133 мс 3,13 мс 12000 BM_SomeFunction/2816/iterations:500/threads:24 0,132 мс 3,08 мс 12000 BM_SomeFunction/2944/iterations:500/threads:24 0,131 мс 3,09 мс 12000 BM_SomeFunction/3072/iterations:500/threads:24 0,132 мс 3,10 мс 12000 BM_SomeFunction/3072/iterations:500/threads:24 0,132 мс 3,11 мс 12000 BM_SomeFunction/3200/iterations:500/threads:24 0,117 мс 2,72 мс 12000 BM_SomeFunction/3328/iterations:500/threads:24 0,113 мс 2,66 мс 12000 BM_SomeFunction/3456/iterations:500/threads:24 0,111 мс 2,61 мс 12000 BM_SomeFunction/3584/iterations:500/threads:24 0,112 мс 2,63 мс 12000 BM_SomeFunction/3584/iterations:500/threads:24 0,112 мс 2,63 мс 12000 BM_SomeFunction/3712/iterations:500/threads:24 0,271 мс 6,35 мс 12000 BM_SomeFunction/3840/iterations:500/threads:24 0,270 мс 6,35 мс 12000 BM_SomeFunction/3968/iterations:500/threads:24 0,274 мс 6,42 мс 12000 BM_SomeFunction/4096/iterations:500/threads:24 0,276 мс 6,49 мс 12000 BM_SomeFunction/4096/iterations:500/threads:24 0,273 мс 6,41 мс 12000 BM_SomeFunction/4352/iterations:500/threads:24 0,151 мс 3,53 мс 12000 BM_SomeFunction/4608/iterations:500/threads:24 0,146 мс 3,45 мс 12000 BM_SomeFunction/4864/iterations:500/threads:24 0,142 мс 3,36 мс 12000 BM_SomeFunction/5120/iterations:500/threads:24 0,144 мс 3,40 мс 12000 BM_SomeFunction/5120/iterations:500/threads:24 0,146 мс 3,40 мс 12000 BM_SomeFunction/5376/iterations:500/threads:24 0,196 мс 4,57 мс 12000 BM_SomeFunction/5632/iterations:500/threads:24 0,187 мс 4,39 мс 12000 BM_SomeFunction/5888/iterations:500/threads:24 0,191 мс 4,47 мс 12000 BM_SomeFunction/6144/iterations:500/threads:24 0,188 мс 4,39 мс 12000 Отчет об испытаниях:
BM_SomeFunction/1792/iterations:500/threads:24 0,095 мс 2,12 мс 12000 означает, что выделение 1792 байт памяти требует 2,12 мс процессорного времени.
Тестовый код #include "benchmark/benchmark.h" #include "jemalloc/jemalloc.h" статический size_t kBatchSize = 10000; static void alloc_mem_n(size_t size) { std::vector kVec(kBatchSize, 0); for (int i = 0; i Единица(тест::кмиллисекунда) ->Итерации(500) ->Темы(24) ->DenseRange(1792, 2048, 64) ->DenseRange(2048, 2560, 128) ->DenseRange(2560, 3072, 128) ->DenseRange(3072, 3584, 128) ->DenseRange(3584, 4096, 128) ->DenseRange(4096, 5120, 256) ->DenseRange(5120, 6144, 256); БЕНЧМАРК_ГЛАВНЫЙ();
В процессе тестирования производительности jemalloc-5.2.0 по выделению памяти small_class было обнаружено, что время выделения памяти в 4096 байт было значительно выше, чем у другой памяти small_class. Есть ли какая-то специальная обработка выделения памяти размером 4096 байт в jemalloc? Или есть какая-то другая причина?
Результаты теста: [*]Используйте тест Google с многопоточным тестом (24 потока).
Работа на (32 процессорах X 3400 МГц) Кэш процессора: Данные L1 32 КиБ (x16) Инструкция L1 32 КиБ (x16) L2 унифицированный 256 КиБ (x16) L3 унифицированный 20480 КиБ (x2) Средняя нагрузка: 15,72, 14,21, 14,26 -------------------------------------------------- --------------------------------------- Тестовое время итераций процессора -------------------------------------------------- --------------------------------------- BM_SomeFunction/1792/iterations:500/threads:24 0,095 мс 2,12 мс 12000 BM_SomeFunction/1856/iterations:500/threads:24 0,175 мс 4,10 мс 12000 BM_SomeFunction/1920/iterations:500/threads:24 0,178 мс 4,13 мс 12000 BM_SomeFunction/1984/iterations:500/threads:24 0,177 мс 4,14 мс 12000 BM_SomeFunction/2048/iterations:500/threads:24 0,181 мс 4,18 мс 12000 BM_SomeFunction/2048/iterations:500/threads:24 0,177 мс 4,16 мс 12000 BM_SomeFunction/2176/iterations:500/threads:24 0,116 мс 2,67 мс 12000 BM_SomeFunction/2304/iterations:500/threads:24 0,113 мс 2,64 мс 12000 BM_SomeFunction/2432/iterations:500/threads:24 0,118 мс 2,75 мс 12000 BM_SomeFunction/2560/iterations:500/threads:24 0,113 мс 2,65 мс 12000 BM_SomeFunction/2560/iterations:500/threads:24 0,114 мс 2,68 мс 12000 BM_SomeFunction/2688/iterations:500/threads:24 0,133 мс 3,13 мс 12000 BM_SomeFunction/2816/iterations:500/threads:24 0,132 мс 3,08 мс 12000 BM_SomeFunction/2944/iterations:500/threads:24 0,131 мс 3,09 мс 12000 BM_SomeFunction/3072/iterations:500/threads:24 0,132 мс 3,10 мс 12000 BM_SomeFunction/3072/iterations:500/threads:24 0,132 мс 3,11 мс 12000 BM_SomeFunction/3200/iterations:500/threads:24 0,117 мс 2,72 мс 12000 BM_SomeFunction/3328/iterations:500/threads:24 0,113 мс 2,66 мс 12000 BM_SomeFunction/3456/iterations:500/threads:24 0,111 мс 2,61 мс 12000 BM_SomeFunction/3584/iterations:500/threads:24 0,112 мс 2,63 мс 12000 BM_SomeFunction/3584/iterations:500/threads:24 0,112 мс 2,63 мс 12000 BM_SomeFunction/3712/iterations:500/threads:24 0,271 мс 6,35 мс 12000 BM_SomeFunction/3840/iterations:500/threads:24 0,270 мс 6,35 мс 12000 BM_SomeFunction/3968/iterations:500/threads:24 0,274 мс 6,42 мс 12000 BM_SomeFunction/4096/iterations:500/threads:24 0,276 мс 6,49 мс 12000 BM_SomeFunction/4096/iterations:500/threads:24 0,273 мс 6,41 мс 12000 BM_SomeFunction/4352/iterations:500/threads:24 0,151 мс 3,53 мс 12000 BM_SomeFunction/4608/iterations:500/threads:24 0,146 мс 3,45 мс 12000 BM_SomeFunction/4864/iterations:500/threads:24 0,142 мс 3,36 мс 12000 BM_SomeFunction/5120/iterations:500/threads:24 0,144 мс 3,40 мс 12000 BM_SomeFunction/5120/iterations:500/threads:24 0,146 мс 3,40 мс 12000 BM_SomeFunction/5376/iterations:500/threads:24 0,196 мс 4,57 мс 12000 BM_SomeFunction/5632/iterations:500/threads:24 0,187 мс 4,39 мс 12000 BM_SomeFunction/5888/iterations:500/threads:24 0,191 мс 4,47 мс 12000 BM_SomeFunction/6144/iterations:500/threads:24 0,188 мс 4,39 мс 12000 Отчет об испытаниях:
BM_SomeFunction/1792/iterations:500/threads:24 0,095 мс 2,12 мс 12000 означает, что выделение 1792 байт памяти требует 2,12 мс процессорного времени.
Тестовый код #include "benchmark/benchmark.h" #include "jemalloc/jemalloc.h" статический size_t kBatchSize = 10000; static void alloc_mem_n(size_t size) { std::vector kVec(kBatchSize, 0); for (int i = 0; i Единица(тест::кмиллисекунда) ->Итерации(500) ->Темы(24) ->DenseRange(1792, 2048, 64) ->DenseRange(2048, 2560, 128) ->DenseRange(2560, 3072, 128) ->DenseRange(3072, 3584, 128) ->DenseRange(3584, 4096, 128) ->DenseRange(4096, 5120, 256) ->DenseRange(5120, 6144, 256); БЕНЧМАРК_ГЛАВНЫЙ();
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение