Author Topic: why is the latest QB64 so slow?  (Read 14191 times)

0 Members and 1 Guest are viewing this topic.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: why is the latest QB64 so slow?
« Reply #15 on: December 21, 2018, 01:40:31 pm »
I can confirm the same results:  8 seconds vs 0.4 seconds.

I guess the thing to do now is grab various older versions of QB64 and see when/what caused execytion times to drop so dramatically.  It’s a 20 to 1 difference for me, in Win 10.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: why is the latest QB64 so slow?
« Reply #16 on: December 21, 2018, 01:52:38 pm »
Running the test program on various versions of QB64 that I have on my machine, I get similar times all the way back to version 0.980 (the first official GL release).  Testing QB64 v o.954 (the last SDL version), I get similar times.

Whenever the issue is, it’s not something new introduced into the language itself.

Windows just updated itself recently; I wonder if there was something in the update which affected 32-bit run times?  Does anyone on Linux/Mac see these different speeds?  It’s a huge difference with just some simple math...
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #17 on: December 21, 2018, 02:30:08 pm »
no problem on macOS, latest dev version

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #18 on: December 21, 2018, 02:57:11 pm »
Windows 10 32-bit version 1803, 10+ seconds
could it be the gcc toolchain?

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #19 on: December 21, 2018, 03:01:30 pm »
If I read thru this entire thread, then I remember a discussion years ago on an Amiga related forum. Many people did speed tests with a very simple program, while most got acceptable results, some very few had timing peeks in the test, which were unusual high.

The issue turned finally out to be related to the processor's instruction cache, or more precise to wrong MMU table setups, which marked some memory areas as "not cachable". Whenever it did happen, that a program was loaded into such a non cachable memory region (and hence executed from there), then the program went extremly slow, as the processor didn't cache/prefetch the program's instructions, but always made a memory access to fetch the next instruction. This got most obvious in tight loops, which usually would fit into the instruction cache entirely, so that no further memory access (by instruction, not data) would be required until the loop exits.

Long text..., my best guess is a non-optimal BIOS/Firmware configuration (cache related settings) on that slow machines.

Another thought of my own, what's about faulty/defect hardware, anything which will (by error) throw lots of interrupt requests, which the processor must handle with high priority compared to the normal priority any programs usually run with.
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #20 on: December 21, 2018, 04:50:42 pm »
Remember the recent BIOS updates related to Meltdown and Spectre? Those caused slow downs, even on tests Steve had posted on here some time ago. Could it be that?

May have to do with caching and predicting, nothing to do with qb64 itself?

https://www.bleepingcomputer.com/news/security/list-of-meltdown-and-spectre-vulnerability-advisories-patches-and-updates/

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #21 on: December 21, 2018, 05:22:18 pm »
Quote
Windows just updated itself recently; I wonder if there was something in the update which affected 32-bit run times?  Does anyone on Linux/Mac see these different speeds?  It’s a huge difference with just some simple math...

Interesting, so how are Petr and Cobalt immune? Disabled updates or USA only affected?

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #22 on: December 21, 2018, 05:44:18 pm »
I just tested another math intensive program and got a significant improvement to time since the last time I time tested it:
(version x32 2398884) was 21 secs now 4 secs!


Offline Fifi

  • Forum Regular
  • Posts: 181
    • View Profile
    • My small QB64 contribution
Re: why is the latest QB64 so slow?
« Reply #23 on: December 21, 2018, 06:45:34 pm »
Hi all,

BTW, how can I know what QB64 version (32 or 64 bit) runs on Linux when I'm on a 64 bit distribution since the About dialog does not specifies this information (that should be nice to add)?

TIA
It's better to look like an idiot for a short time while asking something obvious to an expert than pretending to be smart all your life. (C) Me.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: why is the latest QB64 so slow?
« Reply #24 on: December 21, 2018, 06:49:22 pm »
Hi all,

BTW, how can I know what QB64 version (32 or 64 bit) runs on Linux when I'm on a 64 bit distribution since the About dialog does not specifies this information (that should be nice to add)?

TIA

When you start QB64, before you load a program, what’s the title say?  QB64x32, or QB63x64?
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #25 on: December 21, 2018, 07:25:16 pm »
Hi
LOL

I have a cavernman notebook... :-) see results of the test on my TOSHIBA
4GB RAM Celeron Win10 64bit

See the next time (Greek civilization?)
Programming isn't difficult, only it's  consuming time and coffee

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #26 on: December 21, 2018, 07:45:07 pm »
From his screenshot, Petr is running 64-bit qb64. That's why the ~0.5 sec execution times.

With the 32-bit qb64, Windows 10 version 1709, Core i5 laptop, got 13 seconds and change, on just about all of them. One just topped 14 seconds.

Also 32-bit qb64, Windows 10 version 1809, Core i7 desktop, I get 10 seconds and little change, like less than 10.3 seconds.

So, I have to believe, it's not so much the Windows version? Looks more like 32-bit vs 64-bit qb64, and then maybe something related to those BIOS updates, which affect the 32-bit way of doing things in 64-bit processors?

Offline Fifi

  • Forum Regular
  • Posts: 181
    • View Profile
    • My small QB64 contribution
Re: why is the latest QB64 so slow?
« Reply #27 on: December 21, 2018, 08:00:00 pm »
Hi SMcNeill,

When you start QB64, before you load a program, what’s the title say?  QB64x32, or QB63x64?

Thank you for this information since I did not noticed that detail on the title bar before loading a source file (I mainly use QB64 with its command line and the -x -o parameters).

BTW, it could be nice to show that information in the About dialog.

Thanx again.
Fifi
It's better to look like an idiot for a short time while asking something obvious to an expert than pretending to be smart all your life. (C) Me.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #28 on: December 21, 2018, 11:56:37 pm »
I can confirm the same results:  8 seconds vs 0.4 seconds.

I guess the thing to do now is grab various older versions of QB64 and see when/what caused execytion times to drop so dramatically.  It’s a 20 to 1 difference for me, in Win 10.

with windows VISTA I get a max of 1 sec test times. I am not seeing anything higher with any build I have. from the 82 build of Nov 2017 to a development build on 10\30 to the one I just downloaded today. all have very simular run times. just a slight change of less than .1 secs in the latest build. those test where all on the same machine so no change in hardware or OS.
Granted after becoming radioactive I only have a half-life!

Offline jack

  • Seasoned Forum Regular
  • Posts: 408
    • View Profile
Re: why is the latest QB64 so slow?
« Reply #29 on: December 22, 2018, 10:33:58 pm »
@Cobalt
what are the specs of your PC?