microbenchmark

What does allocation rate means in JMH

对着背影说爱祢 提交于 2020-08-24 10:41:09
问题 I'm trying to measure the memory consumed when running the benchmark. I found out on the internet that I can use GC profiler to measure that. I tried but I don't understand the answer as well as see the amount of consumed memory. Can anyone explain the results? Thanks. MyBenchmark.testMethod_width_2_attribute_text ss 60 32.345 ± 1.759 ms/op MyBenchmark.testMethod_width_2_attribute_text:·gc.alloc.rate ss 60 26.904 ± 0.217 MB/sec MyBenchmark.testMethod_width_2_attribute_text:·gc.alloc.rate.norm

What does allocation rate means in JMH

安稳与你 提交于 2020-08-24 10:40:48
问题 I'm trying to measure the memory consumed when running the benchmark. I found out on the internet that I can use GC profiler to measure that. I tried but I don't understand the answer as well as see the amount of consumed memory. Can anyone explain the results? Thanks. MyBenchmark.testMethod_width_2_attribute_text ss 60 32.345 ± 1.759 ms/op MyBenchmark.testMethod_width_2_attribute_text:·gc.alloc.rate ss 60 26.904 ± 0.217 MB/sec MyBenchmark.testMethod_width_2_attribute_text:·gc.alloc.rate.norm

What does allocation rate means in JMH

回眸只為那壹抹淺笑 提交于 2020-08-24 10:40:11
问题 I'm trying to measure the memory consumed when running the benchmark. I found out on the internet that I can use GC profiler to measure that. I tried but I don't understand the answer as well as see the amount of consumed memory. Can anyone explain the results? Thanks. MyBenchmark.testMethod_width_2_attribute_text ss 60 32.345 ± 1.759 ms/op MyBenchmark.testMethod_width_2_attribute_text:·gc.alloc.rate ss 60 26.904 ± 0.217 MB/sec MyBenchmark.testMethod_width_2_attribute_text:·gc.alloc.rate.norm

Why does adding an xorps instruction make this function using cvtsi2ss and addss ~5x faster?

99封情书 提交于 2020-08-05 04:47:31
问题 I was messing around with optimizing a function using Google Benchmark, and ran into a situation where my code was unexpectedly slowing down in certain situations. I started experimenting with it, looking at the compiled assembly, and eventually came up with a minimal test case that exhibits the issue. Here's the assembly I came up with that exhibits this slowdown: .text test: #xorps %xmm0, %xmm0 cvtsi2ss %edi, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0

Why does adding an xorps instruction make this function using cvtsi2ss and addss ~5x faster?

若如初见. 提交于 2020-08-05 04:47:11
问题 I was messing around with optimizing a function using Google Benchmark, and ran into a situation where my code was unexpectedly slowing down in certain situations. I started experimenting with it, looking at the compiled assembly, and eventually came up with a minimal test case that exhibits the issue. Here's the assembly I came up with that exhibits this slowdown: .text test: #xorps %xmm0, %xmm0 cvtsi2ss %edi, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0

Why does adding an xorps instruction make this function using cvtsi2ss and addss ~5x faster?

爱⌒轻易说出口 提交于 2020-08-05 04:47:09
问题 I was messing around with optimizing a function using Google Benchmark, and ran into a situation where my code was unexpectedly slowing down in certain situations. I started experimenting with it, looking at the compiled assembly, and eventually came up with a minimal test case that exhibits the issue. Here's the assembly I came up with that exhibits this slowdown: .text test: #xorps %xmm0, %xmm0 cvtsi2ss %edi, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0 addss %xmm0, %xmm0

Simple for() loop benchmark takes the same time with any loop bound

核能气质少年 提交于 2020-06-21 05:22:06
问题 I'm willing to write a code that makes my CPU execute some operations and see how much time does he take to solve them. I wanted to make a loop going from i=0 to i<5000 and then multiplying i by a constant number and time that. I've ended up with this code, it has no errors but it only takes 0.024 seconds to execute the code even if I change the loop i<49058349083 or if i<2 it takes the same amount of time. Whats the error? PD: I started yesterday learning C++ i'm sorry if this is a really