Simple Benchmarks

basically miscellaneous, if it doesn't fit another sub-forum enter it here, we might even promote it to its own sub-forum
Post Reply
basicchip
Posts: 946
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Simple Benchmarks

Post by basicchip » Thu Jan 17, 2019 5:28 am

I should have published something like this a long time ago. Of course you can find CoreMark tests for all these CPUs. But I thought I would give a simple test of BASIC with a floating point divide in the loop.

Code: Select all

dim x as single
x=1000000
while x>1
i=i+1
x=x/1.0001
loop
The variable i was there just to count iterations - 138140

Rooted around the office for various parts -- some never became products, or were specials versions for OEM customers

And the envelope please--
  • LPC824 4193 msec
  • LPC1549 3719 msec
  • LPC11U68 2855 msec
  • LPC11U37 2706 msec
  • LPC1114 2700 msec
  • Teensy3.2 795 msec
  • LPC1751 519 msec
  • LPC1756 511 msec
  • LPC54102 101 msec
  • LPC4078 73 msec
  • LPC54005 43 msec
  • LPC4330 39 msec
  • GPD PC 31 msec Atom x7 z8750 1.6 GHz
  • Dell PC 9 msec i5 3330S 2.76 GHz
Now the PC's are interpreting the BASIC, not compiled like the ARM



basicchip
Posts: 946
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: Simple Benchmarks

Post by basicchip » Sun Jan 20, 2019 5:41 pm

Mike just walked me through generating code for SAMD21 -- known as Arduino Zero

and --
  • SAMD21 1887 msec
Check the blog at https://www.coridium.us/coridium/blog/some-benchmarks for more complete numbers

basicchip
Posts: 946
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: Simple Benchmarks

Post by basicchip » Mon Jan 21, 2019 5:44 am

Just for reference here is an equivalent program in C for another CPU. If you don't declare the variables volatile, gcc can optimize the whole loop out of existance.

Code: Select all

#include "mstimer.h"

volatile int i;
volatile float x;

int main()                                    // Main function
{
  printf("starting\n");
  mstime_set(0);
  mstime_start();
  i = 1000000;
  while (i) {      
    i=i-1;  // same speed i--;
  }
  mstime_stop();
  printf("integer time %d\n",mstime_get());

 
  mstime_set(0);
  mstime_start();
  x = 1000000;
  while (x>1) {
    i=i+1;
    x=x/1.0001;
  }    
  mstime_stop();
  printf("float time %d\n",mstime_get()); 
}

basicchip
Posts: 946
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: Simple Benchmarks

Post by basicchip » Fri Feb 22, 2019 3:16 am

And for an older CPU, the float was 73994 msec, and integer time was 9399 msec. Yep chips have gotten faster over the years.

basicchip
Posts: 946
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: Simple Benchmarks

Post by basicchip » Mon Aug 19, 2019 2:55 pm

I found a PC BASIC that is compiled rather than interpreted. It is QB64 and compiles to 64 bit op codes, it comes it about 10x faster than the PC-ARMbasic emulator.

Added that to the benchmarks blog table. https://www.coridium.us/coridium/blog/some-benchmarks

Post Reply