BBC BASIC for Windows
IDE and Compiler >> Debugging >> Slow execution when clicking 'Run'
http://bb4w.conforums.com/index.cgi?board=debugging&action=display&num=1517705792

Slow execution when clicking 'Run'
Post by Gian7281 on Feb 3rd, 2018, 11:56pm

Hello,

I wrote a short program which fits in one page.
When I click 'Run' (without compiling it) it takes about 12-15 seconds to get a result on screen on my Win7 Pro, overclocked (4.4Ghz) PC with SSD drive.
Same program takes 1 seconds on my Win 8.1 MS Surface tablet.
I cannot explain the difference in performance and what it is slowing down BBC Basic considering that I can compile and run the same program in C in 1 second on my PC.

Any advise on that matter is much appreciated.

Many thanks,

Gian
Re: Slow execution when clicking 'Run'
Post by michael on Feb 4th, 2018, 8:06pm

Quote:
I cannot explain the difference in performance and what it is slowing down BBC Basic considering that I can compile and run the same program in C in 1 second on my PC.


That is irrelevant to BBC Basic for Windows.

Firstly, you have provided no code.

Secondly, C is not the easiest language to get things done.

If you find C to be a good platform to perform the tasks you need to do, then use it.



Re: Slow execution when clicking 'Run'
Post by DDRM on Feb 5th, 2018, 1:19pm

Hi Gian,

Given recent arguments, I feel constrained to point out that you would get more expert advice at the "other" forum:

http://bbcbasic.conforums.com/

In the meantime....

BBC BASIC is an interpreted language, and a 10-fold slower execution than a compiled C program probably isn't surprising. It's more surprising if you are getting significantly faster execution of the same program (in the same language) on your tablet.

Do other BB4W programs run at different speeds on the two devices?

If you can post code others of us will have a look, and maybe try it out. Things which tend to be "very slow" are writing to the screen 1 pixel at a time, or deeply nested multiple loops.

You can post code in a code box by sandwiching it between tags: use (code] and (/code] tags - but with both square brackets - I've changed to round so it doesn't do it!

Best wishes,

D
Re: Slow execution when clicking 'Run'
Post by Gian7281 on Feb 7th, 2018, 5:57pm

Hi,

Sorry, I think there has been a misunderstanding.

I was not making a comparison between BBC Basic and C, rather I tried to work out what might interfere with the correct functioning of BBC Basic in a Windows O/S.

I was trying to find out why the same code took 10-15 longer on a powerful PC compared to my Surface tablet.

Eventually I was advised by Mr Russell (that Mr Russell at www.bbcbasic.co.uk) to check whether the printer I was connected to was offline and indeed that was the cause.
Nothing to do with code.

Regards,
Gian

Re: Slow execution when clicking 'Run'
Post by michael on Feb 8th, 2018, 12:29am

Quote:
I was not making a comparison between BBC Basic and C, rather I tried to work out what might interfere with the correct functioning of BBC Basic in a Windows O/S.

I was trying to find out why the same code took 10-15 longer on a powerful PC compared to my Surface tablet.


No worries. Text is misleading and inflammatory.

I was just trying to get more information and suggesting that if C was doing what you needed, then it may be the right choice.

( In my opinion, BBC Basic is far easier than most languages and provides a classic style editor. Its a very stable tool and makes it easy to get things done)

Best wishes,
Michael