Arduino Forum
>
Using Arduino
>
Programming Questions
>
Speed of Arduino compared to PC...
Print
Go Down
Pages:
[1]
Topic: Speed of Arduino compared to PC...
(Read 1 time)
previous topic
-
next topic
westfw
Shannon Member
Posts: 13,459
Karma: 1373
[add]
Strongly opinionated, but not official!
Speed of Arduino compared to PC...
Mar 15, 2012, 09:16 am
So I'm taking the free online Stanford class in Cryptography, and the first assignment has one of those "with a little thought you can solve this in a loop with less than 2^28 iterations" problems. For kicks, I thought I'd run it on an Arduino as well as on my (someone aged) 2.8GHz Xeon desktop. The straightforward implementation takes about 7500 seconds on a 16MHz Arduino. A bit of obvious optimization (eliminating 32bit multiplications and modulus and replacing them with repeated additions and conditional bounds checking) reduces that to only about 1500s.
It takes about 0.5s on the desktop (either way.)
So there you have it. An Arduino is about 15000 times slower than a Mac. :-)
DuaneB
Edison Member
Posts: 1,673
Karma: 42
[add]
RC Car Meets Arduino
Re: Speed of Arduino compared to PC...
#1
Mar 15, 2012, 10:51 am
Hi,
Interesting, unless my maths is wrong, taking clock speed alone, you would expect around 175 times slower. Is my maths wrong or is there a lot of floating point or multi byte maths in your algorithm ?
Duane B
rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html
Rcarduino.blogspot.com
AWOL
Guest
Re: Speed of Arduino compared to PC...
#2
Mar 15, 2012, 10:55 am
It's not just clock speed, it's data path width, and some instructions doing more in one clock cycle.
nickgammon
Global Moderator
Nick Gammon
Brattain Member
Posts: 28,066
Karma: 3443
[add]
Lua rocks!
http://www.gammon.com.au
Re: Speed of Arduino compared to PC...
#3
Mar 15, 2012, 11:01 am
A lot would depend on the algorithm, but I believe a lot of cryptographic stuff is designed to run on low-power, low-speed devices, like smart cards. A "reference" implementation may not be designed to be optimized for those situations though.
Please post technical questions on the forum, not by personal message. Thanks!
More info:
http://www.gammon.com.au/electronics
Print
Go Up
Pages:
[1]
Loading...