[Done] Editor slow

Post bugs related to the IDE here
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

[Done] Editor slow

Post by DoubleDutch »

Has anyone else noticed that the editor (Windows) has gone really slow in PureBasic 6.00? (I mean for fairly large programs with about 50,000 lines)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
BarryG
Addict
Addict
Posts: 3293
Joined: Thu Apr 18, 2019 8:17 am

Re: Editor slow

Post by BarryG »

My app is currently 37000 lines and the IDE isn't slow for me with 6.00 beta 5.

In what way do you mean slow? Slow to react to typing or something?
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Editor slow

Post by DoubleDutch »

Scrolling, etc. I'm running Windows x64 btw in case that is a factor.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
BarryG
Addict
Addict
Posts: 3293
Joined: Thu Apr 18, 2019 8:17 am

Re: Editor slow

Post by BarryG »

SAD UPDATE: I'm using 6.03 beta 5 and my main app is now 41000 lines, and YES, it's very slow now when using the arrow keys to move around the text, to the point where I can't really edit with it or even use it anymore. It works fine with much smaller sources (like 2000 lines). I've had to put off updating my own app for now, because it's literally impossible to work on it.

Further: I'll type something and nothing will happen for a few seconds, and then the text will suddenly appear and type itself in a small rush. Holding down the right arrow key to scroll across a line takes FOREVER, but if I down Ctrl+Shift when doing this (to select text as I do it) makes it all go fast again.

This slow IDE problem occurs even with a clean fresh install of PureBasic with no prefs file existing yet.

Note: If I open a second tab in the IDE while my big source is open, the smaller source in the second tab responds fast and normally. When I switch back to the big source's tab, everything is slow in it again. So the slowdown appears to be directly related to the size of the source in a given tab.

Fred, does the above info help diagnose the problem?

[Edit] Here's a small GIF that shows what happens when I hold the Down Arrow key in my source - you can see how the scrolling down stops and starts and is very jerky and slow to respond. Literally all I'm doing is holding down that key.

Image
Last edited by BarryG on Sat Sep 09, 2023 12:15 am, edited 1 time in total.
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Editor slow

Post by mk-soft »

I can confirm that v6.03b5 is very slower.
This is due to the number of variables and functions. With v6.02 this is just about right

Build many vars and functions

Code: Select all

Global txt.s

For i = 1 To 2000
  Debug "Global iVal_" + i
Next

Debug ""

For i = 1 To 5000
  Debug "Procedure funct_" + i + "(param.s)"
  Debug "  Protected var1"
  Debug "EndProcedure"
  Debug ""
Next
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Editor slow

Post by luis »

I can also confirm this, tried 6.02 and 6.03 B5 and there is a noticeable difference.
Just by loading a 100K line source jumping from the top to the end it's almost immediate with 6.02, requires around 2 seconds with 6.03 B5.
Didn't try anything else but it's enough to say something is fishy :)

BTW: is the IDE now compiled with the C complier or not ?
"Have you tried turning it off and on again ?"
A little PureBasic review
Fred
Administrator
Administrator
Posts: 16621
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Editor slow

Post by Fred »

May be due to the newer Scintilla DLL version, you can try with the old one to see if it change anything
nsstudios
Enthusiast
Enthusiast
Posts: 274
Joined: Wed Aug 28, 2019 1:01 pm
Location: Serbia
Contact:

Re: Editor slow

Post by nsstudios »

Can confirm.
Pasting the code generated by mk-soft's code in the earlier post freezes the ide for a bit both in the case of 6.02 and 6.03, but navigating through the code felt ~2x slower with 6.03 b5 than with 6.02.
Notepad++ which also uses Scintilla as far as I know doesn't seem to lag at all when pasting or navigating.
Replacing pb 6.03 b5 Scintilla with pb 6.02 one makes it a lot faster, even faster than 6.02, but autocomplete crashes the ide, which makes me think that it doesn't load it properly, or something.
---------------------------
Error
---------------------------
An Error has been detected in the IDE!

Error: Invalid memory access

File : SourceParser.pb

Line : 2552



IDE build on 08/18/2023 [16:15] by Fred

Branch: devel Revision: 06f08909e43f
---------------------------
OK
---------------------------
Does PB use Scintilla's lexer at all?
Since version 5 of scintilla, lexer became its own project called lexilla, wonder if that has anything to do with it?
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Editor slow

Post by mk-soft »

I compiled the current IDE Beta 5 with the old scintilla library from v6.02 under macOS.
To do this, I replaced the scintilla lib in the resources.
It's because of the library. With the old libray it runs normally fast again.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
BarryG
Addict
Addict
Posts: 3293
Joined: Thu Apr 18, 2019 8:17 am

Re: Editor slow

Post by BarryG »

mk-soft wrote: Fri Sep 08, 2023 4:12 pmI replaced the scintilla lib in the resources.
nsstudios wrote: Fri Sep 08, 2023 2:33 pmReplacing pb 6.03 b5 Scintilla with pb 6.02 one makes it a lot faster
How did you do that? My PureBasic 6.03 b5 install doesn't have "Scintilla.lib" in the "Compilers" folder, and replacing "Scintilla.dll" in there with the 6.02 version doesn't make it any faster for me.

Edited my other post with a small GIF to show the problem.
nsstudios
Enthusiast
Enthusiast
Posts: 274
Joined: Wed Aug 28, 2019 1:01 pm
Location: Serbia
Contact:

Re: Editor slow

Post by nsstudios »

I just copied the dll, which seems to make it faster here, but also the IDE crashes on autocomplete, so they're probably not compatible.
It's good to know that compiling the IDE with the older version of Scintilla works like before. Thank you for trying that mk-soft.
BarryG
Addict
Addict
Posts: 3293
Joined: Thu Apr 18, 2019 8:17 am

Re: Editor slow

Post by BarryG »

nsstudios wrote: Sat Sep 09, 2023 12:32 amcompiling the IDE with the older version of Scintilla works like before
Not for me. Same slow speed and scrolling.
nsstudios
Enthusiast
Enthusiast
Posts: 274
Joined: Wed Aug 28, 2019 1:01 pm
Location: Serbia
Contact:

Re: Editor slow

Post by nsstudios »

That's concerning. Hopefully the team can have a look into what's happening.
BarryG wrote: Sat Sep 09, 2023 1:21 am
nsstudios wrote: Sat Sep 09, 2023 12:32 amcompiling the IDE with the older version of Scintilla works like before
Not for me. Same slow speed and scrolling.
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Editor slow

Post by luis »

The concern is mounting after this shocking statement: "we don't expect another beta release."
Maybe this has been silently addressed ?
Will hopes be shattered ?

EDIT: The intended tone of this post was humorous, and to be read with the intonation of a news anchor commenting on the latest news. In case someone didn't get it (someone didn't) and find it offensive or detrimental to the efforts put in by the team. So, will this help ?

BTW: it was being silently addressed.
Last edited by luis on Mon Sep 11, 2023 11:17 am, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
Fred
Administrator
Administrator
Posts: 16621
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Editor slow

Post by Fred »

After investigation, it seems than this bug fix is causing the slow down: viewtopic.php?t=62847. We now use unicode compliant string comparison which is slower than before when using the #PB_String_NoCase. As the IDE is using a lot of CompareMemortString(), we will need to optimize that on the IDE side (we don't need unicode case comparaison for most of it anyway, as it's PB keywords).
Post Reply