Page 2 of 7

Re: Very slow editor - independent of settings

Posted: Wed Oct 23, 2024 7:47 pm
by dangerfreak
HeX0R wrote: Wed Oct 23, 2024 7:43 pm
dangerfreak wrote: Wed Oct 23, 2024 7:33 pm
HeX0R wrote: Wed Oct 23, 2024 7:25 pm You could use the IDE source, compile it with debugger on, add some debug outputs here and there, and you should find the part which slows things down.
The length of the source code slows down the editor continously - the content doesn't make a difference. As I wrote before, the editor/purebasic also is extremely slow with a blank editor when opening the menu "File -> Preferences".

Remember: On one of my computers purebasic and the editor is really fast, with the same preferences and source code!
I don't think you got what I was saying.
Right 😁 . Well ok, now I know what you mean (really!). But I don't have a clue how to do that.

Re: Very slow editor - independent of settings

Posted: Wed Oct 23, 2024 9:56 pm
by Nituvious
Does this only happen in the editor. Can you open files at normal times in other editors?

Re: Very slow editor - independent of settings

Posted: Wed Oct 23, 2024 10:05 pm
by dangerfreak
Yes, for example notepad++ is very fast on all of my computers.

Re: Very slow editor - independent of settings

Posted: Wed Oct 23, 2024 10:12 pm
by BarryG
dangerfreak wrote: Wed Oct 23, 2024 7:33 pmRemember: On one of my computers purebasic and the editor is really fast, with the same preferences and source code!
So it's a PC problem and nothing to do with PureBasic.

Re: Very slow editor - independent of settings

Posted: Wed Oct 23, 2024 11:26 pm
by Quin
BarryG wrote: Wed Oct 23, 2024 10:12 pm
dangerfreak wrote: Wed Oct 23, 2024 7:33 pmRemember: On one of my computers purebasic and the editor is really fast, with the same preferences and source code!
So it's a PC problem and nothing to do with PureBasic.
That's a big assumption, I can tell you first hand that an app behaving one way on one machine and completely differently on another is quite a common occurance. There could be any number of factors, from a misconfigured mouse on all the machies it happens on to a weird pointer error in the IDE that only happens on Tuesdays and when it's exactly 32.1 degrees C where Fred lives. You never know.


Edited to add this: for example, on one of my machines, the menu bar of PureBasic read absolutely fine with my screen reader. On all the rest, it did not. "PC issue", I can already hear you saying. But it wasn't! It turned out to be the icons on menu bar items not playing nice with NVDA, on only certain machines. Never did figure out why.

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 5:58 am
by dangerfreak
Quin wrote: Wed Oct 23, 2024 11:26 pm That's a big assumption,[...]
Yes, you are right, it could still be a Purebasic problem. On the other hand, there might be a solution somewhere hidden in Windows. I think it's remarkable, that it takes "forever" just to open the preferences. First it takes a while, until the (empty) preferences window appears. Then it takes some seconds until the menu tree and the options appear. It probably sounds weird, but maybe it's some kind of graphics (or graphic card) problem?

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 8:03 am
by Fred
Yes, what you are describing looks like a driver issue, but the other apps behaves correctly ? PB IDE is a native app using native controls, so there is no way it could take that much time just to render the preference window. Could you post a video with the task manager visible ?

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 8:57 am
by ChrisR
dangerfreak wrote: Wed Oct 23, 2024 6:15 pm I just noticed another interesting thing: I started Purebasic and didn't load a project, the editor is EMPTY. Then I clicked on the menu "File -> Preferences" - it takes 10 seconds until the preferences window appears! On my only fast working computer, this only takes one second.
To help understand, I've built a test version PureBasic.zip (my environment is ready)
By adding multiples ElapsedMilliseconds(), in OpenPreferencesWindow() procedure and at the end of the main markers, without looking further into the code.
And at the end of OpenPreferencesWindow(), copy the times to the clipboard + message.
It should help to see where it slows down.

Here on my laptop:

Code: Select all

EnsureWindowOnDesktop  = 267
General = 32
Editor = 32
Compiler = 1
Debugger = 1
ToolsPanel = 2
Total OpenPreferencesWindow Time = 411

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 9:09 am
by dangerfreak
Fred wrote: Thu Oct 24, 2024 8:03 am Yes, what you are describing looks like a driver issue, but the other apps behaves correctly ? PB IDE is a native app using native controls, so there is no way it could take that much time just to render the preference window. Could you post a video with the task manager visible ?
Yes, all other apps work correctly. Here is the video: https://www.dropbox.com/scl/fi/s6bd67mg ... m86of&dl=1

The same happens when loading a project - CPU usage is rising, RAM and HD is normal.

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 9:14 am
by Fred
That's very slow for sure. Even my 15 years old i7 open the prefs in less than a second :D

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 9:16 am
by dangerfreak
ChrisR wrote: Thu Oct 24, 2024 8:57 am
dangerfreak wrote: Wed Oct 23, 2024 6:15 pm I just noticed another interesting thing: I started Purebasic and didn't load a project, the editor is EMPTY. Then I clicked on the menu "File -> Preferences" - it takes 10 seconds until the preferences window appears! On my only fast working computer, this only takes one second.
To help understand, I've built a test version PureBasic.zip (my environment is ready)
By adding multiples ElapsedMilliseconds(), in OpenPreferencesWindow() procedure and at the end of the main markers, without looking further into the code.
And at the end of OpenPreferencesWindow(), copy the times to the clipboard + message.
It should help to see where it slows down.

Here on my laptop:

Code: Select all

EnsureWindowOnDesktop  = 267
General = 32
Editor = 32
Compiler = 1
Debugger = 1
ToolsPanel = 2
Total OpenPreferencesWindow Time = 411
My result:

EnsureWindowOnDesktop = 1050
General = 334
Editor = 180
Compiler = 9
Debugger = 3
ToolsPanel = 9
Total OpenPreferencesWindow Time = 1997

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 9:21 am
by Fred
Just a shot in the dark, I compiled the IDE using the C backend: https://www.purebasic.com/beta/windows_ ... eBasic.exe

You can test it and see it makes any differences (might be several mem misalignment issues or something)

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 9:23 am
by dangerfreak
Fred wrote: Thu Oct 24, 2024 9:14 am That's very slow for sure. Even my 15 years old i7 open the prefs in less than a second :D
I bet it's the same problem loading a project. Loading a .pb file with 297kb takes 20 seconds for me. Editing the source code is a pain, because scrolling or even moving the cursor takes very long, sometimes it's freezing for some seconds.

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 9:28 am
by dangerfreak
Fred wrote: Thu Oct 24, 2024 9:21 am Just a shot in the dark, I compiled the IDE using the C backend: https://www.purebasic.com/beta/windows_ ... eBasic.exe

You can test it and see it makes any differences (might be several mem misalignment issues or something)
Many thanks for your help, unfortunately it didn't work - opening the preferences still takes very long, I can see no difference :cry: .

Re: Very slow editor - independent of settings

Posted: Thu Oct 24, 2024 9:33 am
by Fred
dangerfreak wrote: Thu Oct 24, 2024 9:23 am
Fred wrote: Thu Oct 24, 2024 9:14 am That's very slow for sure. Even my 15 years old i7 open the prefs in less than a second :D
I bet it's the same problem loading a project. Loading a .pb file with 297kb takes 20 seconds for me. Editing the source code is a pain, because scrolling or even moving the cursor takes very long, sometimes it's freezing for some seconds.
And for small files it works as expected ? The IDE has a file of 300 kb (preferences.pb) and it works very fast here.