Recent

Author Topic: Speed up Lazarus??  (Read 11696 times)

BLL

  • Sr. Member
  • ****
  • Posts: 276
Speed up Lazarus??
« on: August 08, 2013, 08:42:53 pm »
Hi, I am running Lazarus on my RasPi. Can anyone help me with these problems:

1). I know that the RasPi has a 700MHz processor and that Lazarus sits atop LXDE, in my case, but I can't understand why it is soooooo slow navigating around the source code or moving up or down the Object Inspector with the cursor keys. No compiling is taking place and yet it is ridiculously slow compared with say, navigating around a text document in Leafpad. I have messed with keyboard repeat etc to absolutely no avail! It also often ignores mouse clicks! Is there any way to improve this?
2). I am developing a program which reads data from a USB gps and this aslo sends the keyboard haywire, but in spurts. Is there any way to minimise this?

3). I have to turn the debugger off so the LNet components don't cause SIGSEV errors, which then means the IDE is unstable!

Put these things together and Lazarus becomes the most frustrating and time wasting program I have ever used in 30 years of computing!! Coding which should take no time at all ends up taking hours!

Debian-wheezy, fpc 2.7.1, Lazarus 1.1

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4676
  • I like bugs.
Re: Speed up Lazarus??
« Reply #1 on: August 08, 2013, 10:40:07 pm »
1). I know that the RasPi has a 700MHz processor and that Lazarus sits atop LXDE

How much RAM there is?
« Last Edit: August 08, 2013, 10:47:53 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12121
  • Debugger - SynEdit - and more
    • wiki
Re: Speed up Lazarus??
« Reply #2 on: August 08, 2013, 10:42:53 pm »
the editor is usually fast (moving caret / scrolling)

code navigation (pascal) is too, but it does need more scanning of the entire source


maybe try switch off certain highlights. to do so, set all colors for the HL to to-color
- ifdef lowlight
- markup all occurrences of word under caret

try another font. MUST be MONO-spaced.

---
use a profiler to see where the time goes

macaruchi

  • New Member
  • *
  • Posts: 30
Re: Speed up Lazarus??
« Reply #3 on: August 08, 2013, 11:45:56 pm »
For PI really is frustating..!! but Pi is not the piece of hardware to develop , I recommend use for developing a PC and use PI to compile the project and run.

Do you run the project compiled ? How fast is it ? Do you test with version of repo ,0.9.30?

I have 5 days trying to install ZeosDBO on my Lazrus with PI to just compile my poject but 'til now it is MI  :D

Do you install Zeos with that version?




ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Speed up Lazarus??
« Reply #4 on: August 09, 2013, 06:58:11 am »
I have a similar experience with a small arm based netbook (400Mhz, 256M RAM, 1G swap on USB stick). The problem is that lazarus is doing a lot of repaints and they are very slow. Drawing a new window takes seconds. It starts with a gray area with a border and then you can wait for seconds before the controls are drawn. Opening a menu takes ages. Typically you have already clicked again on the button because you think it didn't get the click and when finally the menu opens it closes again because of that second click. Moving a window takes seconds to redraw. People that are running lazarus on fast machines over SSH with X forwarding are seeing exactly the same. Lazarus causes a lot of X traffic (much more than other programs) and the ARM cpu is just choking. But there is exactly where I found a kind of solution: I run lazarus now over ssh. It is still not fast but it is a huge improvement. Much better reactivity, Far less problems with clicks disappearing. And as a bonus, I can use a larger screen.

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Speed up Lazarus??
« Reply #5 on: August 09, 2013, 10:49:41 am »
Hi, Thanks for all the replies. I will look at font, colours etc. The program is absolutely fine when run outside Lazarus. I find ssh from my PC via RPDDesktop even slower than working on the Pi direct. I found 0.9.30 so out of date, some components wouldn't even install. It was just as slow as 2.7.1/1.1 is! As my program is using a gps and getting data from localhost, port 2947, you can't do that on the PC! Oh for a slicker Lazarus!!

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12121
  • Debugger - SynEdit - and more
    • wiki
Re: Speed up Lazarus??
« Reply #6 on: August 09, 2013, 11:16:48 am »
your program is slow or the IDE is slow?

and you may want to try fpc 2.6.2 or 2.6.3 ( with either lazarus 1.1 or 1.0.10)

2.7.1 has new strings, which in some cases can be a bit slower (though it should not usually be an issue)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Speed up Lazarus??
« Reply #7 on: August 09, 2013, 11:18:52 am »
As my program is using a gps and getting data from localhost, port 2947, you can't do that on the PC! Oh for a slicker Lazarus!!
You can use Lazarus on your desktop to write the program. Stick the Pi-specific stuff in {$IFDEF Linux} conditionals (and you can write stubs to emulate/mock up functionality for windows).
Then you can compile and test everything except the pi-specific bits on Windows.

Copy over the sources to your pi and build with lazbuild - any errors will show up.
You can then adjust the source code on Windows etc.

It sounds like a lot of work but it's not so bad - and you can develop cross-platform programs quite nicely like this.

Alternatively, you could try setting up a Laz desktop=>PI cross compiler but I suspect that's a lot of hassle. If somebody has done it, please let me know the procedure/the required GUI library names so I can incorporate a cross compiler module in fpcup. Thanks.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: Speed up Lazarus??
« Reply #8 on: August 09, 2013, 11:57:34 am »
I have a similar experience with a small arm based netbook (400Mhz, 256M RAM, 1G swap on USB stick). The problem is that lazarus is doing a lot of repaints and they are very slow. Drawing a new window takes seconds

Afaik Rasp.PI drawing is notoriously slow, since the GPU is hardly supported.  Work is being done on a (Wayland) driver for the BMA gpu, expected next year afaik. (wayland based raspbian)

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Speed up Lazarus??
« Reply #9 on: August 09, 2013, 12:46:22 pm »
Hi, It's not my program which is slow, it's Lazarus. It makes watching paint dry seem like an action-packed activity!! Apparently, fpc 2.6.2 isn't supported by the Pi, hence 2.7.1, but the old 2.6.0/0.9.30 was just as slow. Let's hope this Wayland (whatever that is) can come to the rescue. As to doing the developing on a faster machine, that's fine, but murphy will ensure that that which you have to do on the Pi will be the troublesome part!!

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Speed up Lazarus??
« Reply #10 on: August 09, 2013, 01:11:30 pm »
Have you tried changing some of the editor settings? Something like tooltips could be disabled.

avra

  • Hero Member
  • *****
  • Posts: 2584
    • Additional info
Re: Speed up Lazarus??
« Reply #11 on: August 09, 2013, 01:24:38 pm »
As my program is using a gps and getting data from localhost, port 2947, you can't do that on the PC!
Of course you can. Change your application to read from Pi's IP address instead of localhost, and you can develop everything on PC. Or record traffic from Pi's port 2947 and create small TCP server which will simulate it locally on PC.

You can also try to limit GPU memory to 16, 32, and 64 MB and try each setting to see if there is any improvement. Of course do not start anything else in LXDE like internet browser or some other software.

You can also run X server like XMing on Windows, and then forward display to your PC so PC handles all drawing. This can be done even if LXDE is not started so you can have more memory. For this you will need to google around a little.

Alternatively you can run QEMU raspberry pi virtual machine on your PC instead of original Pi.
« Last Edit: August 09, 2013, 01:28:44 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4676
  • I like bugs.
Re: Speed up Lazarus??
« Reply #12 on: August 09, 2013, 01:36:35 pm »
It's not my program which is slow, it's Lazarus.

Your program is an LCL GUI application? I don't know how this is possible as Lazarus IDE also uses LCL. Maybe it happens with any big enough program.
But yes, I also hate sluggish programs. FPC compiles to native binary and one would expect snappy behavior.
What is the main cause of this slowness? Widgetset bindings? Is Lazarus IDE itself doing something sloppy? Somebody should profile it.
Custom drawing may be one solution in situations with limited HW resourses.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Speed up Lazarus??
« Reply #13 on: August 09, 2013, 02:05:07 pm »
Gosh, I am getting confused here. I didn't realise I could read 2947 on the PC. I am new to all this! I have unchecked everything I don't need in the editor and it's a bit better. I have gpu_mem at 16, so Lazarus can rebuild its IDE if it needs to, without running out of memory. I did try 32 and default 64 but no performance change, just the inability to rebuild IDE!

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Speed up Lazarus??
« Reply #14 on: August 09, 2013, 02:30:23 pm »
I have tried the LNet test program and my program on the PC, replacing local host with my Pi's ip address (192.168.1.4) and I get  "Error on connect:connection refused" message, when trying to access port 2947 for the gps data.

 

TinyPortal © 2005-2018