Author Topic: Upgrade woes  (Read 492 times)

0 Members and 1 Guest are viewing this topic.

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 275
  • Needle nardle noo. - Peter Sellers
Upgrade woes
« on: November 08, 2020, 06:55:08 AM »
I upgraded from XP to Win 10 yesterday, and went from QB64 32 bit v1.3 to 64 bit v1.4.   Someone gave me their old
comp, and it's similar to what I had - both dual core and same memory. Is it normal that my compile times doubled, and
that the IDE  is using over 30% CPU even when the code has been checked and I see OK at the bottom?  The editor is
sluggish too.  I've tried all the settings suggested online to make to make Win 10  faster.  What a turkey!
It works better if you plug it in.

Online jack

  • Seasoned Forum Regular
  • Posts: 275
Re: Upgrade woes
« Reply #1 on: November 08, 2020, 08:01:32 AM »
Hi Richard
how much CPU usage is Windows Defender using while you are using QB64 or programs compiled with it?
several days ago I had a severe slowdown due to defender using up-to 44% of CPU usage

Online FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 2710
  • LET IT = BE
    • QB64.org
Re: Upgrade woes
« Reply #2 on: November 08, 2020, 08:11:03 AM »
Make sure you've whitelisted your QB64 folder from live scanning.

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 275
  • Needle nardle noo. - Peter Sellers
Re: Upgrade woes
« Reply #3 on: November 09, 2020, 12:43:55 AM »
So it took me 2 days to find the problem.  It was a BIOS setting - only one CPU enabled.
Way too funny.  Should I tell the guy who gave me the computer what the problem was?
Reminds me of a cable TV guy who encountered the "problem" of a device plugged into
an outlet controlled by a light switch. 
It works better if you plug it in.

Online bplus

  • Forum Resident
  • Posts: 5944
  • B+ Knot again!
Re: Upgrade woes
« Reply #4 on: November 09, 2020, 01:16:07 AM »
So it took me 2 days to find the problem.  It was a BIOS setting - only one CPU enabled.
Way too funny.  Should I tell the guy who gave me the computer what the problem was?
Reminds me of a cable TV guy who encountered the "problem" of a device plugged into
an outlet controlled by a light switch.

Wow that so fits your signature!

"Should I tell the guy who gave me the computer what the problem was?"
I am curious what you decide :)


Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 275
  • Needle nardle noo. - Peter Sellers
Re: Upgrade woes
« Reply #5 on: November 09, 2020, 04:32:49 AM »
Putting QB64 and whatever I'm currently working on (chess.exe) in the whitelist improved the speed even
more than turning on the 2nd CPU, thanks. The editor is now usable without having the patience of a saint.

The switch to 10 shows me that my approach to graphics re my chess program is all wrong - I can't be
constantly recreating the entire screen and expect the CPU load to be low.  Big rewrite to do. 
It works better if you plug it in.

Online SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3230
    • Steve’s QB64 Archive Forum
Re: Upgrade woes
« Reply #6 on: November 09, 2020, 06:27:42 AM »
Putting QB64 and whatever I'm currently working on (chess.exe) in the whitelist improved the speed even
more than turning on the 2nd CPU, thanks. The editor is now usable without having the patience of a saint.

The switch to 10 shows me that my approach to graphics re my chess program is all wrong - I can't be
constantly recreating the entire screen and expect the CPU load to be low.  Big rewrite to do.

Wouldn’t you just use _PUTIMAGE to move a piece?


Pre-play:
Draw the board, save it as background.
Draw the initial pieces on a zero-alpha screen, have _BLEND turned OFF.

During play:
Set _blend off.
When the user moves, take the square with the zero-alpha background and _PUTIMAGE it to wherever it belongs, then draw blank zero-alpha tile where the old piece was.

With blend still off, draw the background.
Turn blend on, draw the pieces

While player  is “thinking”:
Draw nothing, as nothing has changed
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Kernelpanic

  • Newbie
  • Posts: 98
Re: Upgrade woes
« Reply #7 on: November 09, 2020, 09:04:07 AM »
Hello Richard,
have you ever thought of buying a newer used PC? Here is a reputable company for used PC & Co, but I don't know if they also deliver overseas.
If you are interested, you can send them an email.

https://www.afb-group.de/en/home/
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 275
  • Needle nardle noo. - Peter Sellers
Re: Upgrade woes
« Reply #8 on: November 09, 2020, 03:11:20 PM »
Yes SMcNeill, it would be that simple if I didn't have the plasma effect to make the
white squares look like marble, which I'd like to keep.  Not static marble....maybe
more like filaments of my neurons drifting in space.  'Tis pretty.  Anyway, it's a
challenge, and I'm sure I'll find a better method than the retarded one I've currently
got (replotting EVERYTHING).  Like much of what I've ever coded, I go for the end
result, and get it, but without sufficient planning which means there's sometimes a
problem like this.  Hopefully I'll find a solution without using hardware images, which
I don't understand at all.  I didn't even know there WAS a problem until I started
running it in Win 10.  XP is kosher with it - uses about half the CPU. 

You've given me a new avenue to explore - _BLEND.  Don't know what it is/does.  I
was a-gonna try an approach that relied on the opacity of _RBGA.  I check your idea,
thanks!



« Last Edit: November 09, 2020, 03:14:38 PM by Richard Frost »
It works better if you plug it in.

Online SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3230
    • Steve’s QB64 Archive Forum
Re: Upgrade woes
« Reply #9 on: November 09, 2020, 03:28:53 PM »
_BLEND is the command that tells our program if we’re using alpha channels and blending colors, or not.  If it’s off, we just draw to the screen (red stays red).  When it’s on, we blend our image onto the screen (red might blend to become pink). 

It’s faster to just draw to the screen (blend off), than it is to blend it and then draw it.  If you don’t need blending, just keep it off.  (Its on by default.)

Even with your marbled tiles, all you need is:

Draw the board, make a copy of it.  (_COPYIMAGE)
Draw the pieces on the original board.

When a move is made:
_PUTIMAGE the tile portion of the copy where the piece started at.
_PUTIMAGE the tile portion of the copy where the piece ended at.
Draw (or _PUTIMAGE) the piece at its new end position.

Three simple draws each move (clear a spot, clear a spot, draw the piece), with no changes to the display needed until the next move is made.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 275
  • Needle nardle noo. - Peter Sellers
Re: Upgrade woes
« Reply #10 on: November 09, 2020, 04:30:48 PM »
Yes, it'd be sensible to have a master image of the board, only to be updated when necessary, but there'll still be far
more popping that image to the active screen than that to have smoothly sliding pieces, another feature I don't wish to lose. 
The plasma moves all the time, unless turned off.  That'll be tougher, but I gots me an idear.  And if the idea doesn't
work, fine, I'm retired and have lots of time to try something else.

It isn't merely bad planning that got me into this mess.  QB64 is so fast that I made the mistake of thinking the power was
unlimited.  And it is, sort of.  The code is doing exactly what I want.  It just runs too hot on some machines.  FAR too
hot, like a toaster oven.  And causes other processes to stutter, making a concert piano sound like a bandsaw.  Somehow I
can't convince myself that these are "features".

The CPU usage does come down a lot if the program is whitelisted, but I can't count on users doing that, so I'll cut the CPU
time down with an efficient graphics handling scheme. 
« Last Edit: November 09, 2020, 04:35:43 PM by Richard Frost »
It works better if you plug it in.

Offline frenti

  • Newbie
  • Posts: 1
Re: Upgrade woes
« Reply #11 on: November 24, 2020, 05:52:27 AM »
What about buying a new, but refurbished PC? This company would be a good option, I think: https://bb-net.international/tecxl/
Already bought a laptop, can´t say anything bad.

Offline Richard Frost

  • Seasoned Forum Regular
  • Posts: 275
  • Needle nardle noo. - Peter Sellers
Re: Upgrade woes
« Reply #12 on: November 25, 2020, 03:07:32 AM »
A dual core Lenovo SL510 @ 2Ghz isn't all that bad.  Machines haven't gotten much faster - only more cores, which won't
help QB64.  Strange that this machine isn't in the approved list for Win10 (maybe that's the problem).  It's plenty fast for
most things, just not my chess program.  Anyway, a slow machine means I have to do half-decent coding to get good results. 
I can always fire up the XP machine for blistering speed!
It works better if you plug it in.