Lazarus

Using the Lazarus IDE => Designer => Topic started by: ertank on November 02, 2017, 11:59:15 am

Title: Total build time
Post by: ertank on November 02, 2017, 11:59:15 am
Hello,

I am currently on Lazarus 1.8.0RC5.

I know that total build time is in verbose messages. If you are working on a slow system like Raspberry Pi you do really wonder (I mean it because it sometimes takes more than the time I prepare myself a filtered coffee) how long it took and how many lines compiled in total (as if in Delphi build screen).

Is there a way to see both after build finishes? I mean without any need to see all these verbose messages, only these two information?

Thanks.
Title: Re: Total build time
Post by: Ñuño_Martínez on November 04, 2017, 11:49:25 am
I was about to suggest to pass some command line options to the compiler but I can't find any one that would help you except "-vs" (shows time stamps).  %)
Title: Re: Total build time
Post by: Leledumbo on November 04, 2017, 12:28:54 pm
There used to be "show compile dialog" in environment options. I can't find it anymore, though (I don't need it anyway so I turned it off last time I can still find it).
Title: Re: Total build time
Post by: ertank on November 04, 2017, 03:58:36 pm
I fail to find a method other than using verbose listing in messages.
Title: Re: Total build time
Post by: Thaddy on November 04, 2017, 05:06:49 pm
If you are working on a slow system like Raspberry Pi
Which RaspberryPi? 1? maybe, 3? not an issue.....On an RPi3.
Title: Re: Total build time
Post by: ertank on November 04, 2017, 05:43:22 pm
Which RaspberryPi? 1? maybe, 3? not an issue.....On an RPi3.
It is Raspberry Pi 3 and it is an issue. Building takes about 2 minutes on average. It may not be CPU but microsd card. I am trying fast USB (directly booting and using). Seems better. Still building takes time.
Title: Re: Total build time
Post by: valdir.marcos on November 04, 2017, 06:12:39 pm
It is Raspberry Pi 3 and it is an issue. Building takes about 2 minutes on average. It may not be CPU but microsd card. I am trying fast USB (directly booting and using). Seems better. Still building takes time.

I do not use ARM to program, but SD cards and Micro SD cards have different brands, models, prices and useful lives.
May you try other Micro SD cards?
https://www.howtogeek.com/189897/how-to-buy-an-sd-card-speed-classes-sizes-and-capacities-explained/
https://www.kingston.com/us/flash/sd_cards
Title: Re: Total build time
Post by: ertank on November 04, 2017, 06:38:56 pm
I do not use ARM to program, but SD cards and Micro SD cards have different brands, models, prices and useful lives.
May you try other Micro SD cards?
https://www.howtogeek.com/189897/how-to-buy-an-sd-card-speed-classes-sizes-and-capacities-explained/
https://www.kingston.com/us/flash/sd_cards
Sd card I am using is Class 10 Samsung EVO+ 32GB I especially selected that card at the time I  was searching one. It was among the best when I placed my order in the past. However, sdcard speeds are about 4-8MB/second on average. Now I am testing Sandisk Extreme 64GB USB3.1 USB memory stick (thanks to RPi3 it has USB boot support). I get about 25MB/second sequential write speeds on this one. Nearly SSD speeds on an USB stick and for less amount of money.

Still, OS is using 4k blocks and writing 4k blocks in the background most of the time (log writes, database writes, etc). Raspberry Pi I/O is shared by cable ethernet, USB ports and sdcard if I am not mistaken. Real world speeds are dropping on regular use. Think about adding Lazarus builds on top of this.

Project I am working is a long term. I have built that project nearly 600 times now. Having build time visible on the screen will give me a brief idea about how much time I keep waiting on builds. Besides, it is a nice piece of information to have anyway.

P.S. I believe it was this web page I used to select my sd card. I got 4.5mb/sec on sequential writes (dd) web page on the other hand displays 14mb/sec
https://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-microsd-card
Title: Re: Total build time
Post by: Thaddy on November 04, 2017, 06:53:02 pm
Which RaspberryPi? 1? maybe, 3? not an issue.....On an RPi3.
It is Raspberry Pi 3 and it is an issue. Building takes about 2 minutes on average. It may not be CPU but microsd card. I am trying fast USB (directly booting and using). Seems better. Still building takes time.
The class of SD card does not matter too much.
Lazarus itself build takes 2 minutes indeed (but also on my daughters Intel 64 laptops)
FPC takes closer to 5-7 minutes on a RPi3/Raspbian Jessie. Also note that Raspbian is much, much faster than any other distribution.

What you can do is create a swap file of 1 Gig. That helps.
Both are very complex programs, so that is to be expected.
If your own programs take longer than seconds there is indeed something wrong.

How long takes a Lazarus rebuild on yours?

Best way to time is actually do a build from the command line and write a little shellscript...
That way you exclude Lazarus overhead.
Title: Re: Total build time
Post by: balazsszekely on November 04, 2017, 07:09:44 pm
@ertank
Why don't you debug the IDE and find out where that specific line is added to the message window? The build progress dialog was removed in Lazarus 1.4, when the compiling process became multi-threaded.
Title: Re: Total build time
Post by: ertank on November 04, 2017, 08:21:05 pm
@ertank
Why don't you debug the IDE and find out where that specific line is added to the message window? The build progress dialog was removed in Lazarus 1.4, when the compiling process became multi-threaded.
Lazarus is about 3.5 million lines of code. Lots of units. I do not know which specific units I should be looking at. I do not know how I can debug it, too. Might give it a shot when I find some time provided some information about units though.
Title: Re: Total build time
Post by: balazsszekely on November 04, 2017, 08:24:23 pm
Quote
Lazarus is about 3.5 million lines of code. Lots of units. I do not know which specific units I should be looking at. I do not know how I can debug it, too. Might give it a shot when I find some time provided some information about units though.
In the mean time I did it for you. It took me five minutes to find the relevant code. Can you apply a patch?
Title: Re: Total build time
Post by: ertank on November 04, 2017, 08:29:26 pm
The class of SD card does not matter too much.
Lazarus itself build takes 2 minutes indeed (but also on my daughters Intel 64 laptops)
FPC takes closer to 5-7 minutes on a RPi3/Raspbian Jessie. Also note that Raspbian is much, much faster than any other distribution.

What you can do is create a swap file of 1 Gig. That helps.
Both are very complex programs, so that is to be expected.
If your own programs take longer than seconds there is indeed something wrong.

How long takes a Lazarus rebuild on yours?

Best way to time is actually do a build from the command line and write a little shellscript...
That way you exclude Lazarus overhead.
My own project takes between 90 seconds - 150 seconds (depending on if I am doing other stuff).

I honestly do not remember how long Lazarus takes to build. Did not measure it. I do not think it is 2 minutes though. A lot more than that.

I keep swap size at 1GB constantly. Maybe slowness is also related with a lot of paging. Did not check this.

Most of the time, I am adding new units and functions which needs testing. So, I use IDE debugging. Might try command line builds. Not sure if I will find them convenient though.

Thanks for suggestions.
Title: Re: Total build time
Post by: Thaddy on November 04, 2017, 08:31:31 pm
IDE debugging is for debugging the IDE, not for debugging your program!!!!!....... Maybe that's your problem.... O:-)
Title: Re: Total build time
Post by: ertank on November 04, 2017, 08:32:00 pm
In the mean time I did it for you. It took me five minutes to find the relevant code. Can you apply a patch?
I appreciate that.

I can try to apply a patch. I do not know how to make a diff file for patch purposes and do not know svn much. But, I can try to figure.
Title: Re: Total build time
Post by: ertank on November 04, 2017, 08:33:49 pm
IDE debugging is for debugging the IDE, not for debugging your program!!!!!....... Maybe that's your problem.... O:-)
That was not a reply to your debugging IDE question, of course  :)
Just wanted to explain command line builds may not be so convenient in my case.
Title: Re: Total build time
Post by: Thaddy on November 04, 2017, 08:35:43 pm
There is no point in applying a patch when you absolutely have no clue < and now I am really grumpy... >:D >:D >:D >:D >:D>
Ths is written from a RPi3, with both trunks, build fresh every day...... NO PATCHES PLZ. Simply turn IDE debugging OFF and normal debugging ON.

Clear?  >:( >:( >:( >:(
Title: Re: Total build time
Post by: JuhaManninen on November 04, 2017, 08:37:06 pm
I know that total build time is in verbose messages.
...
Is there a way to see both after build finishes? I mean without any need to see all these verbose messages, only these two information?
What verbose messages do you mean?
The environment options page "Messages Window" has a checkbox for : Show FPC message "lines compiled".
The output will be the last line in the Messages window.

BTW, a clean build of Lazarus takes ~4 minutes in my ASRock Beebox with Celeron N3000. It must be much slower in a Raspberry Pi.
A clean build is not always needed of course.
Title: Re: Total build time
Post by: balazsszekely on November 04, 2017, 08:37:41 pm
Quote
I appreciate that.
I can try to apply a patch. I do not know how to make a diff file for patch purposes and do not know svn much. But, I can try to figure.
1. Apply the attached patch
2. Rebuild lazarus
3. Go to options, check "Show FPC message..."(see screenshot)
4. Try to build a project or lazarus, you should see a message in the end(line number, time, etc...)
 
PS: This is only for personal use, contains a few hacks but it works.
PS1: Thaddy is grumpy again  :D. Thaddy you should also apply the patch to see how meany line of code your project has + the build time.
PS2: @Juha the problem is when you rebuild lazarus you won't see a thing, since the IDE restarts itself.
Title: Re: Total build time
Post by: JuhaManninen on November 04, 2017, 08:41:40 pm
PS2: @Juha the problem is when you rebuild lazarus you won't see a thing, since the IDE restarts itself.
Ah, OK.
Title: Re: Total build time
Post by: Thaddy on November 04, 2017, 08:46:24 pm
[PS1: Thaddy is grumpy again  :D. Thaddy you should also apply the patch to see how meany line of code your project has + the build time.
Of course I will try the patch..... I wonder if it helps...
RPi 3 is a properly fast system comparable to slowish Intel notebooks if you just want to compile and debug something.

Will report back..... (but I still think somebody is talking nonsense here, not: I am sure of that, and it is not me  >:D)

Again written from a RPi 3....... Sorry for the suckers that can't get it to work.....
Title: Re: Total build time
Post by: ertank on November 04, 2017, 08:46:35 pm
What verbose messages do you mean?
The environment options page "Messages Window" has a checkbox for : Show FPC message "lines compiled".
The output will be the last line in the Messages window.

BTW, a clean build of Lazarus takes ~4 minutes in my ASRock Beebox with Celeron N3000. It must be much slower in a Raspberry Pi.
A clean build is not always needed of course.
If you right click on messages window -> "Filter non urgent messages" -> Check "Filter Debug Messages and below" (just below Filter Verbose Messages and below) then you will be able to see compile time as last line in messages. However, that includes lots of other messages, too. Which is not necessarily needed.

That option is just the one I was looking for anyway. Tested and it works as expected.

Thank you.
Title: Re: Total build time
Post by: Thaddy on November 04, 2017, 08:49:21 pm
What verbose messages do you mean?
The environment options page "Messages Window" has a checkbox for : Show FPC message "lines compiled".
The output will be the last line in the Messages window.

BTW, a clean build of Lazarus takes ~4 minutes in my ASRock Beebox with Celeron N3000. It must be much slower in a Raspberry Pi.
A clean build is not always needed of course.
If you right click on messages window -> "Filter non urgent messages" -> Check "Filter Debug Messages and below" (just below Filter Verbose Messages and below) then you will be able to see compile time as last line in messages. However, that includes lots of other messages, too. Which is not necessarily needed.

That option is just the one I was looking for anyway. Tested and it works as expected.

Thank you.

Did you actually read the patch? You feel happy, but you won't if you need it.....
Title: Re: Total build time
Post by: ertank on November 04, 2017, 08:51:45 pm
Will report back..... (but I still think somebody is talking nonsense here, not: I am sure of that, and it is not me  >:D)

Again written from a RPi 3....... Sorry for the suckers that can't get it to work.....
I am on my RPi 3 all from the beginning as well. Like it very much.

Thaddy, it may not be talking non-sense. It is not always same thing that one person write and another understands. There is language barrier to begin with. Also, different knowledge levels might cause quite a bit of mis-understanding.

I am sorry on my side because you're grumpy.
Title: Re: Total build time
Post by: balazsszekely on November 04, 2017, 08:54:23 pm
@Thaddy
He's just a beginner, give him some time to learn. By the way where is your presentation about randomness? You should make it available for download.

@ertank
When you rebuild Lazarus, you won't see the relevan information since the IDE restart itself.
Title: Re: Total build time
Post by: ertank on November 04, 2017, 09:04:05 pm
@ertank
When you rebuild Lazarus, you won't see the relevan information since the IDE restart itself.
I had difficulty to understand the patch. Not used to read such patches anyway. After your post above, I did figure what it does.

Actually, Juha did reply my question. Which leads me that I used some terms which mis-lead you and maybe Thaddy. I am not by any means trying to learn lines compiled or build time of Lazarus application, if it is re-build in the IDE, or outside of it. What I am trying to learn how long it takes to build my own project that I am developing using Lazarus.

Once again, I am sorry for all the fuss.
Title: Re: Total build time
Post by: balazsszekely on November 04, 2017, 09:48:51 pm
@ertank
Quote
I had difficulty to understand the patch. Not used to read such patches anyway. After your post above, I did figure what it does.
You don't have understand it, you should apply it. A patch is just as quick way to modify one or more unit with a single click.

Quote
Once again, I am sorry for all the fuss.
Don't worry I'm glad you figure it out. One question still remains though: it really takes a few minutes to build an application on raspberry pi? I'm gonna quote you:
"because it sometimes takes more than the time I prepare myself a filtered coffee". How can you develop something on such a slow environment?   
Title: Re: Total build time
Post by: ertank on November 04, 2017, 11:05:05 pm
Don't worry I'm glad you figure it out. One question still remains though: it really takes a few minutes to build an application on raspberry pi? I'm gonna quote you:
"because it sometimes takes more than the time I prepare myself a filtered coffee". How can you develop something on such a slow environment?
I am working on a project. There is a device that will be used in surgeries at hospitals. With some sensors and database and etc on it (sorry, confidentiality issues, can't say more to what it does). As this is being an R&D project. There are a lot of changes. Even to basic built in logic changed once (which drives me crazy).

It is difficult to test everything on another development platform and I found it to be faster to work on the platform that device will be deployed. Testing and finding bugs definitely faster this way. Consider that; if I am to use a faster computer, I have to deploy new executable for testing. If there is a problem, I need to figure it on the RPi 3, if not I return back to code. If not I need to use GDB debugger maybe (I do not know how to use it manually anyway).

It indeed takes quite considerable time to complete my builds on my Raspberry Pi 3 system. Including other libraries used it is about 600.000 lines of code if I build from scratch. As I told earlier, on average it takes 90 seconds - 150 seconds. Rare situations going up about 190 seconds. Moreover, I cannot test built executable right away. It takes about 20-30 seconds for the system to be responsive again (swapping or whatever it is).

However, it is only building that takes time. Writing code is as fast as it is on any other system out there. So, development is not impossible on Raspberry Pi 3, not at all.

Yes, I can prepare myself a good coffee while system is building  :) I purchase whole bean coffee and use my grinder for a fresh coffee experience.
Most of the time system responsiveness is fine and I can debug my freshly build application when I am back with my coffee.

Short answer to your question is: Because I need to earn money (as like anybody else), I am bearing with my own difficulties on the way to earn it.
Title: Re: Total build time
Post by: balazsszekely on November 04, 2017, 11:31:52 pm
@ertank
Good luck with your project.
Title: Re: Total build time
Post by: valdir.marcos on November 05, 2017, 01:56:48 am
Sd card I am using is Class 10 Samsung EVO+ 32GB I especially selected that card at the time I  was searching one. It was among the best when I placed my order in the past. However, sdcard speeds are about 4-8MB/second on average. Now I am testing Sandisk Extreme 64GB USB3.1 USB memory stick (thanks to RPi3 it has USB boot support). I get about 25MB/second sequential write speeds on this one. Nearly SSD speeds on an USB stick and for less amount of money.

Still, OS is using 4k blocks and writing 4k blocks in the background most of the time (log writes, database writes, etc). Raspberry Pi I/O is shared by cable ethernet, USB ports and sdcard if I am not mistaken. Real world speeds are dropping on regular use. Think about adding Lazarus builds on top of this.

Try to overclock a test microSD (please, don't use your main one) to check if it get any faster:
http://www.pidramble.com/wiki/benchmarks/microsd-cards
https://www.raspberrypi.org/forums/viewtopic.php?t=149983
https://www.raspberrypi.org/documentation/installation/sd-cards.md
https://www.raspberrypi.org/documentation/installation/sdxc_formatting.md

Can you have 2 simultaneous microSD cards on your Raspberry Pi 3B?
One microSD card for OS, Lazarus and RDBMS and other [microSD card] for your project to be compiled and database files?
Maybe sharing IO process might speed up your project compiling.
Title: Re: Total build time
Post by: ertank on November 05, 2017, 08:57:46 am
Try to overclock a test microSD (please, don't use your main one) to check if it get any faster:
http://www.pidramble.com/wiki/benchmarks/microsd-cards
https://www.raspberrypi.org/forums/viewtopic.php?t=149983
https://www.raspberrypi.org/documentation/installation/sd-cards.md
https://www.raspberrypi.org/documentation/installation/sdxc_formatting.md

Can you have 2 simultaneous microSD cards on your Raspberry Pi 3B?
One microSD card for OS, Lazarus and RDBMS and other [microSD card] for your project to be compiled and database files?
Maybe sharing IO process might speed up your project compiling.
I have single RPi 3. When I have time, I will see how much overclock helps for SD card.
I do not think I can use more than one SD card on RPi3 and I also believe, bandwidth is shared between sdcard, usb ports and wired ethernet port. So, even it was possible to have two sdcards on a single board, bandwidth will be still same for both together.
Though, USB speeds now I am observing is way above sdcard speeds. Considering USB being faster about 5 times, I am happy for now.
Thank you for the help.
Title: Re: Total build time
Post by: Thaddy on November 05, 2017, 11:36:40 am
I use a ssd over usb and it is 10 times faster as a class 10 sd card. One one of my pi's I only boot from SD and run raspbian jessie from ssd. Another one similar runs from a 5400 usb normal disk, also fast,
but yet two other ones run from sandisk class 10 micro sd. The speeds I mentioned are from the sd cards.
TinyPortal © 2005-2018