News for hackers. Stuff that matters.
Re:Making a Go program 70% faster by avoiding common mistakes by rileymat2 on Thursday March 17, 2016 @09:12AM (#11304090)
A bit off topic, but do we have a standard way to talk about performance improvements in terms of percents?

This went from 131 to 76. The 70% calculation was (start-end)/end. Is this the standard method, because it seems like you would divide by the start timing.

Re:Making a Go program 70% faster by avoiding common mistakes by ant6n on Thursday March 17, 2016 @09:31AM (#11304184)
I find reporting like this the wrong way around. It should be a factor requiring no addition and subtraction, like 1.7x faster.

Similar with compression. If a 8kb file becomes 2kb, the compression factor should be 0.25x.

Re:Making a Go program 70% faster by avoiding common mistakes by greggyb on Thursday March 17, 2016 @02:19PM (#11306371)
This might be pedantic, and I'm sorry, but this is something I always wonder about when I talk about performance.

When we say 1.7x faster, what is a fast? How does fastness increase? It's nearly 2 fasts instead of one?

I think the compression sample you gave is much better. Multiply the original file size by the factor to get the new, compressed file size. This is much better than a statistic that I hear a lot about the compression in a columnstore database we use, where everyone says "7-10x compression", because that was published first and is popular.

I'd prefer to see something like your compression example. It took 8 seconds before, and now takes 2. My optimization makes the operation take .25x the time.

Re:Making a Go program 70% faster by avoiding common mistakes by over on Thursday March 17, 2016 @02:29PM (#11306453)
1.7x faster means oldRunningTime / newRunningTime = 1.7. Or in your example, 8 seconds / 2 seconds = 4x faster. Sometimes this is called a speedup of 4x or a 4x speedup.
Re:Making a Go program 70% faster by avoiding common mistakes by greggyb on Sunday March 27, 2016 @10:38PM (#11372418)
I totally get how the math works. I don't like the language. We're not measuring speed or velocity which can be represented as rates. We're measuring time. Speed would be something like operations per second. We're just measuring seconds.
Re:Making a Go program 70% faster by avoiding common mistakes by richard_todd on Thursday March 17, 2016 @10:30AM (#11304530)
I noticed that too. People get it wrong all the time but the right way to discuss a change relative to the starting value is to divide by the starting value.
Re:Making a Go program 70% faster by avoiding common mistakes by WillAbides on Thursday March 17, 2016 @09:47AM (#11304281)
This calculation makes sense if you compare it to miles per hour or iops. If a car went from 20mph to 30mph you would say its speed increases by 50%. Likewise, using 131ns to 76ns, this went from 7,633 per millisecond to 12,157 per millisecond which is about 72% faster.

The one that bothers me is when people say something got x percent slower.

Re:Making a Go program 70% faster by avoiding common mistakes by rileymat2 on Thursday March 17, 2016 @10:15AM (#11304441)
I guess, but I think my problem is I think of like losing money.

Sort of like losing the amount of time it takes. If I went from $100 to $50. I would say I lost 50% of my money.

Part of me feels like a 50% performance increase is another way to say that I lost 50% of the time it once took.

This is all subjective on my part.