BBC BASIC
« Speed comparison x86 versus ARM »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:39pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Speed comparison x86 versus ARM  (Read 339 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Speed comparison x86 versus ARM
« Thread started on: Oct 6th, 2017, 11:28am »

I have recently acquired a new smartphone, which is one of the fastest currently available (the OnePlus 5, using a Snapdragon 835 CPU). I thought it would be interesting to compare the speed of BBCSDL running on that with it running on an Intel Core i7 clocked at about 2.8 GHz.

I should add that of course the comparison here is not just between CPUs but between an interpreter written in hand-crafted assembler code (x86) and one compiled from C source (ARM). That is why the speed ratios are so variable depending on the nature of the operation performed.

It's also important to appreciate that the ARM has no 80-bit floats (BBCSDL uses 64-bit floats instead) so figures listed as being for that data type cannot be meaningfully compared.

As you will see from the results below, the ARM is typically between 2 and 4 times slower than the x86, but really such a relatively small factor is remarkable in the circumstances. Not only that, but a few of the timing tests actually show the ARM running at a comparable speed to the x86, and in one case (NEXT N#) actually faster!!

I must say I find the results surprising and it really shows how ARM performance has improved, even though it is still a relatively low-power CPU. It also suggests the C compiler is doing a good job. I could speed up the ARM version even more by stripping out all the code which handles 80-bit floats, but I don't want to do that.

Richard.

User Image

User Image
User IP Logged

michael
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 157
xx Re: Speed comparison x86 versus ARM
« Reply #1 on: Oct 24th, 2017, 05:10am »

Quote:
I could speed up the ARM version even more by stripping out all the code which handles 80-bit floats, but I don't want to do that.


Well, you could do it in stages. Then it wouldn't be so time consuming. But the curiosity doesn't lure you to tweak it a bit?

User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: Speed comparison x86 versus ARM
« Reply #2 on: Oct 24th, 2017, 08:26am »

on Oct 24th, 2017, 05:10am, michael wrote:
But the curiosity doesn't lure you to tweak it a bit?

No. I don't want two different versions when one will suffice; it adds complication and makes maintenance more difficult. Significantly, most BASIC benchmark tests measure the speed of control statements, not mathematical computation, so wouldn't be affected by such a change anyway.

If you want a fast version of BBC BASIC there's always Brandy (or Napoleon Brandy on Windows) which has optimisations to overcome the fundamental slowness of an interpreter, especially when coded in a high-level language. My interpreters, whether coded in assembler or C, have no optimisations at all (and never have).

Anyway, I am no longer capable of writing or modifying code of this sort. I was hoping to make it Open Source so that future developments, if any, could be undertaken by others. But there's been literally zero interest from anybody in taking it on.

Richard.
User IP Logged

michael
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 157
xx Re: Speed comparison x86 versus ARM
« Reply #3 on: Oct 25th, 2017, 12:54am »

Quote:
But there's been literally zero interest from anybody in taking it on


I wish I was capable of doing so. I can remember the idea of what I was doing, but unless I am really focused on what I am coding, I always need to write REMs to remind me what my code is doing and forget the syntax of many commands, so I always need to refresh my memory. I use chalk boards to write down my most forgotten things.

I have chalk boards on my walls.. (bout the size you would use in a class)

I program, to help me become better.
User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls