"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "benchmark/libponyrt/mem/heap.cc" between
ponyc-0.33.1.tar.gz and ponyc-0.33.2.tar.gz

About: Pony is an object-oriented, actor-model, capabilities-secure, high performance programming language.

heap.cc  (ponyc-0.33.1):heap.cc  (ponyc-0.33.2)
skipping to change at line 47 skipping to change at line 47
{ {
ponyint_heap_alloc_large(actor, &_heap, alloc_size); ponyint_heap_alloc_large(actor, &_heap, alloc_size);
} else { } else {
ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size)); ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size));
} }
st.PauseTiming(); st.PauseTiming();
ponyint_heap_destroy(&_heap); ponyint_heap_destroy(&_heap);
ponyint_heap_init(&_heap); ponyint_heap_init(&_heap);
st.ResumeTiming(); st.ResumeTiming();
} }
st.SetItemsProcessed(st.iterations()); st.SetItemsProcessed((int64_t)st.iterations());
} }
BENCHMARK_REGISTER_F(HeapBench, HeapAlloc$)->RangeMultiplier(2)->Ranges({{32, 10 24<<10}}); BENCHMARK_REGISTER_F(HeapBench, HeapAlloc$)->RangeMultiplier(2)->Ranges({{32, 10 24<<10}});
BENCHMARK_DEFINE_F(HeapBench, HeapAlloc$_)(benchmark::State& st) { BENCHMARK_DEFINE_F(HeapBench, HeapAlloc$_)(benchmark::State& st) {
pony_actor_t* actor = (pony_actor_t*)0xDBEEFDEADBEEF; pony_actor_t* actor = (pony_actor_t*)0xDBEEFDEADBEEF;
size_t alloc_size = static_cast<size_t>(st.range(0)); size_t alloc_size = static_cast<size_t>(st.range(0));
int num_allocs = static_cast<int>(st.range(1)); int num_allocs = static_cast<int>(st.range(1));
while (st.KeepRunning()) { while (st.KeepRunning()) {
skipping to change at line 71 skipping to change at line 71
ponyint_heap_alloc_large(actor, &_heap, alloc_size); ponyint_heap_alloc_large(actor, &_heap, alloc_size);
} else { } else {
for(int i = 0; i < num_allocs; i++) for(int i = 0; i < num_allocs; i++)
ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size)); ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size));
} }
st.PauseTiming(); st.PauseTiming();
ponyint_heap_destroy(&_heap); ponyint_heap_destroy(&_heap);
ponyint_heap_init(&_heap); ponyint_heap_init(&_heap);
st.ResumeTiming(); st.ResumeTiming();
} }
st.SetItemsProcessed(st.iterations()*num_allocs); st.SetItemsProcessed((int64_t)st.iterations() * num_allocs);
} }
BENCHMARK_REGISTER_F(HeapBench, HeapAlloc$_)->RangeMultiplier(2)->Ranges({{32, 1 024<<10}, {1<<10, 1<<10}}); BENCHMARK_REGISTER_F(HeapBench, HeapAlloc$_)->RangeMultiplier(2)->Ranges({{32, 1 024<<10}, {1<<10, 1<<10}});
BENCHMARK_DEFINE_F(HeapBench, HeapDestroy$)(benchmark::State& st) { BENCHMARK_DEFINE_F(HeapBench, HeapDestroy$)(benchmark::State& st) {
pony_actor_t* actor = (pony_actor_t*)0xDBEEFDEADBEEF; pony_actor_t* actor = (pony_actor_t*)0xDBEEFDEADBEEF;
size_t alloc_size = static_cast<size_t>(st.range(0)); size_t alloc_size = static_cast<size_t>(st.range(0));
ponyint_heap_destroy(&_heap); ponyint_heap_destroy(&_heap);
while (st.KeepRunning()) { while (st.KeepRunning()) {
st.PauseTiming(); st.PauseTiming();
ponyint_heap_init(&_heap); ponyint_heap_init(&_heap);
if(alloc_size > HEAP_MAX) if(alloc_size > HEAP_MAX)
ponyint_heap_alloc_large(actor, &_heap, alloc_size); ponyint_heap_alloc_large(actor, &_heap, alloc_size);
else else
ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size)); ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size));
st.ResumeTiming(); st.ResumeTiming();
ponyint_heap_destroy(&_heap); ponyint_heap_destroy(&_heap);
} }
st.SetItemsProcessed(st.iterations()); st.SetItemsProcessed((int64_t)st.iterations());
ponyint_heap_init(&_heap); ponyint_heap_init(&_heap);
} }
BENCHMARK_REGISTER_F(HeapBench, HeapDestroy$)->RangeMultiplier(2)->Ranges({{32, 1024<<10}}); BENCHMARK_REGISTER_F(HeapBench, HeapDestroy$)->RangeMultiplier(2)->Ranges({{32, 1024<<10}});
BENCHMARK_DEFINE_F(HeapBench, HeapDestroyMultiple$)(benchmark::State& st) { BENCHMARK_DEFINE_F(HeapBench, HeapDestroyMultiple$)(benchmark::State& st) {
pony_actor_t* actor = (pony_actor_t*)0xDBEEFDEADBEEF; pony_actor_t* actor = (pony_actor_t*)0xDBEEFDEADBEEF;
size_t alloc_size = static_cast<size_t>(st.range(0)); size_t alloc_size = static_cast<size_t>(st.range(0));
int num_allocs = static_cast<int>(st.range(1)); int num_allocs = static_cast<int>(st.range(1));
skipping to change at line 115 skipping to change at line 115
ponyint_heap_init(&_heap); ponyint_heap_init(&_heap);
if(alloc_size > HEAP_MAX) if(alloc_size > HEAP_MAX)
for(int i = 0; i < num_allocs; i++) for(int i = 0; i < num_allocs; i++)
ponyint_heap_alloc_large(actor, &_heap, alloc_size); ponyint_heap_alloc_large(actor, &_heap, alloc_size);
else else
for(int i = 0; i < num_allocs; i++) for(int i = 0; i < num_allocs; i++)
ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size)); ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size));
st.ResumeTiming(); st.ResumeTiming();
ponyint_heap_destroy(&_heap); ponyint_heap_destroy(&_heap);
} }
st.SetItemsProcessed(st.iterations()); st.SetItemsProcessed((int64_t)st.iterations());
ponyint_heap_init(&_heap); ponyint_heap_init(&_heap);
} }
BENCHMARK_REGISTER_F(HeapBench, HeapDestroyMultiple$)->RangeMultiplier(2)->Range s({{32, 1024<<10}, {1<<10, 1<<10}}); BENCHMARK_REGISTER_F(HeapBench, HeapDestroyMultiple$)->RangeMultiplier(2)->Range s({{32, 1024<<10}, {1<<10, 1<<10}});
BENCHMARK_DEFINE_F(HeapBench, HeapInitAllocDestroy)(benchmark::State& st) { BENCHMARK_DEFINE_F(HeapBench, HeapInitAllocDestroy)(benchmark::State& st) {
pony_actor_t* actor = (pony_actor_t*)0xDBEEFDEADBEEF; pony_actor_t* actor = (pony_actor_t*)0xDBEEFDEADBEEF;
size_t alloc_size = static_cast<size_t>(st.range(0)); size_t alloc_size = static_cast<size_t>(st.range(0));
ponyint_heap_destroy(&_heap); ponyint_heap_destroy(&_heap);
while (st.KeepRunning()) { while (st.KeepRunning()) {
ponyint_heap_init(&_heap); ponyint_heap_init(&_heap);
if(alloc_size > HEAP_MAX) if(alloc_size > HEAP_MAX)
ponyint_heap_alloc_large(actor, &_heap, alloc_size); ponyint_heap_alloc_large(actor, &_heap, alloc_size);
else else
ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size)); ponyint_heap_alloc_small(actor, &_heap, ponyint_heap_index(alloc_size));
ponyint_heap_destroy(&_heap); ponyint_heap_destroy(&_heap);
} }
st.SetItemsProcessed(st.iterations()); st.SetItemsProcessed((int64_t)st.iterations());
ponyint_heap_init(&_heap); ponyint_heap_init(&_heap);
} }
BENCHMARK_REGISTER_F(HeapBench, HeapInitAllocDestroy)->RangeMultiplier(2)->Range s({{32, 1024<<10}}); BENCHMARK_REGISTER_F(HeapBench, HeapInitAllocDestroy)->RangeMultiplier(2)->Range s({{32, 1024<<10}});
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)