News for hackers. Stuff that matters.
Re:Making a Go program 70% faster with a one character change by hcm on Monday November 14, 2022 @11:22AM (#33596383)
Doh! Thanks for pointing out another silly mistake – I'll fix that.
Re:Making a Go program 70% faster with a one character change by xnorswap on Monday November 14, 2022 @12:22PM (#33597479)
You had it right the first time, 1.7x speed is 70% faster.

If something previously took 4s now takes 2s then it's 100% faster.

Think of driving 10miles. If you drive at 20mph then it takes 30 minutes. If you drive twice as fast, 40mph, it takes 15 minutes.

40mph is 100% faster than 20mph.

Half the time is twice as fast!

Re:Making a Go program 70% faster with a one character change by wizofaus on Monday November 14, 2022 @12:31PM (#33597645)
Glad it wasn't just me thinking this!
Re:Making a Go program 70% faster with a one character change by wizofaus on Monday November 14, 2022 @12:31PM (#33597627)
I disagree, I think the 70% is right, and matches what you still describe as a 1.7x speed increase. If it originally took 4 seconds and now takes 2, I'd call that a 100% speed increase, i.e. twice as fast.
Re:Making a Go program 70% faster with a one character change by markoman on Monday November 14, 2022 @03:53PM (#33600850)
@hcm: Would have loved to see the 'after' flamegraph just for comparison purposes! I'm still trying to get used to groking flamegraphs when optimizing. They're a somewhat new tool, IMO.