4 ms·
Less than one order of magnitude these days. On Tiger Lake, integer multiply is 3 cycles, while integer division is 12 for 32-bit integers and 15 for 64-bit. O
by Tuna-Fish 6y ago
Less than one order of magnitude these days. On Tiger Lake, integer multiply is 3 cycles, while integer division is 12 for 32-bit integers and 15 for 64-bit.
Of course, the multiply is fully pipelined while the division is only partially, but even that leaves only a 10-fold difference.
Division is much faster these days than it used to be. It's still worth it to have compiler optimizations for it, but it's not important to avoid it anymore.
- gowld 6y agoWhy do some people assume decimal ten as the base of the orders of magnitude when discussing binary arithmetic?
- cma 6y agoTimespan/cycle count is almost always denoted in base 10 in conversation.
- mmoskal 6y agoCortex-M4 (think $2) has 1 cycle multiplication and 2-12 cycle division (with early termination). If you go down to Cortex-M0 (think $0.50) then you get software division which is indeed orders of magnitude slower. Of course lower down the line there isn't even hardware multiplication. Interestingly, the ARM11 in original RPi and RPi0 doesn't have hardware integer division (despite being 10x faster than typical M4 and typically having 10000x RAM), but it does have floating point division.
- Fordec 6y ago> Less than one order of magnitude these days. > only a 10-fold difference. A ten fold difference is literally one order of magnitude. Which is what the post you're replying to factually stated.
- cma 6y agoorders usually means 2 or more
- mattkrause 6y agoAlso the actual values were 4-5x (12 or 15 versus 3 cycles), adjusted up to 10x for pipelining.
- cma 6y ago10X is one order of magnitude, 100X is two.
- mattkrause 6y agoIndeed...and 4 to 5x is less than that! My clumsily-made point was that there were two sets of numbers in the GP, and the smaller is unambiguously less than one order of magnitude different.
- Y_Y 6y agoThis depends on context. more often (in my experience) people are using base 10 , but also sometimes 2 or e. Even still people (unfortunately) use "orders of magnitude" like "exponential growth", signifying something like "wow, a lot, but no idea how much".
- bloak 6y agoAnd for astronomers an order of magnitude can sometimes be 100^(1/5) =~ 2.512. I hate it, too, when people call a quadratic curve "exponential".
- Tuna-Fish 6y agoLatency is less than 10-fold. The difference only goes up to one order of magnitude if you pack tons of divisions back to back. And the post I was replying didn't state "an order of magnitude", it stated "orders of magnitude", which are different things.
- jbay808 6y agoEmbedded systems programmers don't always have such luxury!