Closed i3130002 closed 4 years ago
If it makes you feel any better, the same script, with the baud rate bumped up to 115200, run on a STMF103 gives 6 seconds with serial output on, and a mere 3 seconds if no serial output! :-O
Without serial display of all the numbers:
With serial display of all the numbers:
F_CPU value: 72000000
Clock cycles per µsecond: 72
Prime calculation starting.
Found 10000 primes in 6 seconds
Highest prime found was: 104729
This gets more and more ludicrous! Here is the ESP8266 @ 80Mhz then 160Mhz, and then it's big brother, the ESP32 at 160Mhz and then 240Mhz... had to make the code switch to reporting in milliseconds instead of seconds for that one! :-O
Hi Peter
Thanks so much for carrying out these tests!
And I always knew the ESP32 would wipe the floor it’s 32-bit, 240Mhz and even though we’re running on just one core it is a faaaast chip!
And even though the Nano clone LGT8F328P does a good job at 59 seconds (compared to the standard Uno/Nano of 120 seconds) it all just pales into insignificance when the ESP32 does it in less than 1 second, in fact a few ms over ¾ of a second. That is a powerful chip indeed, and we get it for little more than the price of a coffee shop beverage. Amazing.
I’m going to collate all these tests, they should all have been run the same way, however, no serial output except at the end when the test was completed. I’m assuming that was done from your screen shots. I’ll present them in a future video to give them maximum impact and, of course, credit to you for carrying them out.
Best Regards Ralph S Bacon
I’m assuming that was done from your screen shots.
Yes. the screenshots were all with DISPLAY_OUTPUT commented, so only serial output at the end... I ran just the one pass on the STM32 with 115200 baud serial to see how much extra time that added...
I still don't understand how the ESP32 basically halved the time it took compared to the ESP8266 when run at the same clock speed... and seems to be running a lot cooler than the ESP8266 when run at full speed... barely seemed to be warming up. Maybe the ESP8266 was handicapped as it was context switching, whereas the ESP32 was running the job unencumbered by such issues?
Using the following code I ended up finding 10000 of them in 6 seconds. In theory this shouldn't be the true am I missing something ?