BBC BASIC
« Speed comparison x86 versus ARM »

Welcome Guest. Please Login or Register.
Oct 24th, 2017, 11:07am


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

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


member is offline

Avatar




Homepage PM


Posts: 605
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: 101
xx Re: Speed comparison x86 versus ARM
« Reply #1 on: Today at 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: 605
xx Re: Speed comparison x86 versus ARM
« Reply #2 on: Today at 08:26am »

on Today at 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

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls