Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Is this thing fast enough??? Post ReplyPost New Topic
<< Prev Page of 3 Next >>
Author
Message << Prev Topic | Next Topic >>
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2711
Posted: 11 July 2018 at 4:40pm | IP Logged Quote TassyJim

On the Nucleo STM32

Running on computer 'nucleo' on 11-07-2018 at 16:00:00
Starting 1,000,000 iterations of empty loop ...
Finished 1,000,000 iterations of empty loop in 1519ms or 0.0015 ms per iteration.

Starting reading 100 line file 10,000 times ...
Finished reading 100 line file 10,000 times in 369262ms or 0.3693 ms per iteration.

Starting writing 1,000,000 line file ...
Finished writing 1,000,000 line file in 566168ms or 0.5662 ms per iteration.

Starting parse 9 strings from 100,000 strings ...
Finished parse 9 strings from 100,000 strings in 30291ms or 0.0337 ms per iteration.

Starting extracting the value from a string 1,000,000 times ...
Finished extracting the value from a string 1,000,000 times in 16175ms or 0.0162 ms per iteration.

Finished 4,900,000 iterations on computer 'nucleo' in 983431ms or 0.2007 ms per iteration.
===============================================


__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm


Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2404
Posted: 11 July 2018 at 5:34pm | IP Logged Quote matherp

Quote:
I think I had better concentrate on an MMX implementation, unless you can tell me that the Nucleo board will accomodate all my I/O needs.


The Armmite has 91 general purpose I/O of which 26 are analogue capable, 8 support PWM, 5 support count. Any of the 91 can be used for DS18B20, relays etc
Back to Top View matherp's Profile Search for other posts by matherp
 
Paul_L
Guru
Guru


Joined: 03 March 2016
Location: United States
Online Status: Offline
Posts: 426
Posted: 12 July 2018 at 6:29am | IP Logged Quote Paul_L

Well .... food for thought!

@Jim - Thanks, that data is very interesting. Here's a synopsis of the test results (in milliseconds) thus far.

                loop    read file  write file  mid$()  val()    total
Dell i5 3.4GHz   266         7047        2891    1906   1391    13516
Cel Quad 2GHz    844        19219        8203    6125   4157    38579
MM+ @ 100MHz   16257       565035      365102  143456  84823  1174760
MM+ @ 120MHz   13532       491706      325843  119408  70604  1021110
MMX @ 200MHz    6477       202206      189466   64282  33824   496432
MMX @ 252MHz    5109       170491      189127   51147  26971   442913
nucleo          1519       369262      566168   30291  16175   983431

The nucleo is faster than the MMX in the empty loop (3x+), mid$() and val() (<2x), but is slower than the MMX reading the file (<0.5x) and writing the file (0.3x). The nucleo is even slower than the MM+ when writing the file. The file handling parts of the nucleo code seem to be extremely inefficient. I wonder if the slow speed comes from the disk file handling or from the Print #n MMBasic implementation.

@Peter - 91 I/O pins ... that's a lot of I/O! Is that for the chip or for the nucleo board? How easy would it be to adapt a nucleo board to a big touch display and still be able to get the I/O pins out to a breakout board to connect to D-Sub Amphenol cables? That professional nucleo board sure is pretty! What do you think about the nucleo and the ARM core? Will it be as reliable as a PIC? How difficult will it be to write periodic data to an SD card and occasionally either remove the card or dump the data to a tethered PC?

I wonder if the higher processing speed in the math functions will compensate for the slower disk file handling speed in my application.

Thanks for your thoughts everyone!

Paul in NY


Edited by Paul_L on 12 July 2018 at 6:31am
Back to Top View Paul_L's Profile Search for other posts by Paul_L
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2711
Posted: 12 July 2018 at 9:31am | IP Logged Quote TassyJim

File read/write is up to the speed of the SDcard. I am having trouble with my setup so it might not be typical.

I was please that I was able to get the file system to work at all.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
Paul_L
Guru
Guru


Joined: 03 March 2016
Location: United States
Online Status: Offline
Posts: 426
Posted: 12 July 2018 at 1:19pm | IP Logged Quote Paul_L

Hi Jim,

Are you saying that there is that much variability in the speed of SD cards?

A fast card will take 189127 ms writing that monster file under an MMX, then a slow card will take 566168 ms under a nucleo?

That doesn't sound reasonable.

Paul in NY
Back to Top View Paul_L's Profile Search for other posts by Paul_L
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2711
Posted: 12 July 2018 at 2:35pm | IP Logged Quote TassyJim

SD speed standards:
https://www.sdcard.org/developers/overview/speed_class/

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
JohnS
Guru
Guru


Joined: 18 November 2011
Location: United Kingdom
Online Status: Online
Posts: 1698
Posted: 12 July 2018 at 5:17pm | IP Logged Quote JohnS

Paul_L wrote:
Are you saying that there is that much variability in the speed of SD cards?

Yes. There's a big difference.

A bit like hdd compared to a floppy.

John
Back to Top View JohnS's Profile Search for other posts by JohnS
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Offline
Posts: 2404
Posted: 12 July 2018 at 5:27pm | IP Logged Quote matherp

Quote:
The nucleo is even slower than the MM+ when writing the file. The file handling parts of the nucleo code seem to be extremely inefficient.


The STM library routines are inefficient particularly when doing individual character I/O which is how MMBasic works and the test program magnifies that. They are faster when doing larger transfers such as loading an image.

Back to Top View matherp's Profile Search for other posts by matherp
 
lizby
Senior Member
Senior Member


Joined: 17 May 2016
Location: United States
Online Status: Offline
Posts: 255
Posted: 13 July 2018 at 1:22am | IP Logged Quote lizby

Here's the output from running on a Pi Zero W.

Running on computer 'pi-zw' on 12-07-2018 at 11:27:38
Starting 1,000,000 iterations of empty loop ...
Finished 1,000,000 iterations of empty loop in 11763ms or 0.0118 ms per iteration.

Starting reading 100 line file 10,000 times ...
Finished reading 100 line file 10,000 times in 207839ms or 0.2078 ms per iteration.

Starting writing 1,000,000 line file ...
Finished writing 1,000,000 line file in 1.897624000e+06ms or 1.8976 ms per iteration.

Starting parse 9 strings from 100,000 strings ...
Finished parse 9 strings from 100,000 strings in 86038ms or 0.0956 ms per iteration.

Starting extracting the value from a string 1,000,000 times ...
Finished extracting the value from a string 1,000,000 times in 69442ms or 0.0694 ms per iteration.

Finished 4,900,000 iterations on computer 'pi-zw' in 2.272835000e+06ms or 0.4638 ms per iteration.

===============================================

Write to file is a good bit slower than any of the others, perhaps for the reason Peter gave for the Nucleo. Others are generally a bit faster than the MM+ at 120mHz.

The SD card is (nominally, at least) a SanDisk Ultra 16gb class 10.


Edited by lizby on 13 July 2018 at 1:31am
Back to Top View lizby's Profile Search for other posts by lizby
 
Paul_L
Guru
Guru


Joined: 03 March 2016
Location: United States
Online Status: Offline
Posts: 426
Posted: 13 July 2018 at 9:12am | IP Logged Quote Paul_L

TassyJim wrote:
SD speed standards:
https://www.sdcard.org/developers/overview/speed_class/

Well, isn't that interesting. You can get SD cards with write speed ratings from 2MB/sec all the way up to 90MB/sec. My test program writes a 46MB file as follows:

                 ms       MB/sec
i5@5GHz        2891        15.91
Cel@2GHz       8203         5.61
MMX@252      189127         0.24
MMX@200      189466         0.24
MM+@120      325843         0.14
MM+@100      365102         0.13
nucleo       566168         0.08
pi-zw        207839         0.22
The Celeron and the i5 are desktops and were writing to a hard disk. None of the other times approach the slowest speed ratings (2MB/sec) of the slowest SD cards, which leads me to believe that MMBasic is not capable of spitting out data fast enough to stress any SD card when it is not being supported by an underlying Windows, but that it is most efficient when running on a PIC architecture rather than ARM or PI.

Then, in the next paragraph, the SD speed standards mention that disk fragmentation drastically reduces the writing speed of SD cards and suggests that they be reformatted if they are observed writing slowly.

I have no way of knowing the fragmentation level of the cards used in the above tests so I can't judge if fragmentation slowed the writing speeds as observed.

Nothing in this will cause me to not continue to select the MMX for my project.

Paul in NY
Back to Top View Paul_L's Profile Search for other posts by Paul_L
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2711
Posted: 13 July 2018 at 9:30am | IP Logged Quote TassyJim

Just to make things interesting, different operating systems write to disk differently.
Most write to a buffer in memory and only occasionally flush the buffers to disk.
Similar with reads. They read a big chunk on the assumption you are doing a sequential read. They also read/write full sectors, the size of which varies a lot.

It all makes comparisons 'interesting' but not a true indication of raw performance.

Jim


__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2427
Posted: 13 July 2018 at 9:37am | IP Logged Quote Geoffg

An SD card can be driven in a number of modes. 4-bit mode uses 4 signal lines and is used in computers, cameras, etc but last time I looked the protocol was propriety and you had to pay to use it.

SPI mode is free to use and that is what the Micromite Plus uses. In this mode the speed is limited by the speed of the SPI bus so there is no point in buying a fast card.
Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 


<< Prev Page of 3 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1377 seconds.
Privacy Policy     Process times : 0, 0.01, 0, 0.12