any faster way to complie a program?

Previous topic - Next topic

sleepingfish

Hi there, I was wondering if there any was to speed up the bulid process in the GLBasic IDE. It take 20-25 seconds each time for GLBasic to complie a program on my computer. I also wonder if the javascript for html code can be seen in the web browser.

MrTAToad

#1
The compiler should only compile changed files, so it sounds like either lots of files are being modified, or it thinks the files have been modified.

As for the later, no it shouldn't be.

sleepingfish

Thanks for the fast reply. I'm still learning the program so maybe things will get easier the more I use it. Maybe my computer is just super slow.

Wampus

Following from MrTAToad's tip, you should split your source code into many files. That helps because of the Incredibuild skipping unmodified code.

Regarding slow/fast computers, a fast CPU and high performance SSD will definitely help. Also, if you don't need debug mode on then turning that off will reduce compilation time a great deal.

I wonder if putting the Windows temporary directory (that GLBasic uses) onto a ram drive would improve things. Probably not.

Hark0

Quote from: Wampus on 2012-Oct-04
Following from MrTAToad's tip, you should split your source code into many files. That helps because of the Incredibuild skipping unmodified code.

Regarding slow/fast computers, a fast CPU and high performance SSD will definitely help. Also, if you don't need debug mode on then turning that off will reduce compilation time a great deal.

I wonder if putting the Windows temporary directory (that GLBasic uses) onto a ram drive would improve things. Probably not.

+1

Split project in many files its the best solution...

"Incredibuild" only compiles the modified files...

;)
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

spacefractal

20-25 secs is absolute nothing =D.  Here its can take 60secs to compile with command count a bit over 11000. On Android its take about 90 secs to compile and install on it. So its can been pretty slow compared to example BlitzMax.

I do see there could have been some improvements after glbasic v11 with, example, autosplit source files with only contain functions. Another thing is possible to disable the media folder check (which seen take very much time), so glBasic only should compile the code, nothing elsewise checks. Here its could been shorted by adding win32.xcl to the Media folder, so its media copy check got skippet.

A fun note is the compile time to MacOSx is about half of time than Win32. Why, Im not sure.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Moru

Quote from: spacefractal on 2012-Oct-05
20-25 secs is absolute nothing =D.  Here its can take 60secs to compile with command count a bit over 11000. On Android its take about 90 secs to compile and install on it. So its can been pretty slow compared to example BlitzMax.

I remember my 8 MHz Atari computer. It could assemble a program with roughly 10000 lines per second. Of course assembler can't be compared to compiling but still... :-)

spacefractal

Autosplit was meant when compiled to c++, not source files is self :-).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

sleepingfish


Thanks for the info guys. I'll try to make a habit of Split files and test more if having the debug off helps.  :)

bigsofty

#9
I think there are at least 2 passes that GLBasic does for cross-compiling and another 2 for GCC, I would say that speed is quite good considering. One thing though, I noticed that large blocks of DATA  lines slowed my compilation down by quite a bit, this was solved my moving them into files and reading them when the program ran as they were just getting moved into arrays when the program initialised any ways.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Moebius

one thing that's bugged me when I've had to look at the CPP is that line numbers are handled by a #define and #undef per line - tripling the number of lines, but I'm not sure how much of an effect that has on compilation speed though...
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Kitty Hello

Serpent, thats only the gcc preprocessor which is very fast. SSD is a great improvement. Maybe toying with clang might be a future option.

Wampus

I tried an experiment. I created a 2 GB ram drive with SoftPerfect RAM Disk. I installed GLBasic to the ram drive, put the GLBasic temp directory on the ram drive and also a test app on the ram drive. Afterwards I ran comparisons for speed against my main non-SSD hard drive instead. Keeping in mind that I was heavily multitasking at the time, the code in question skips a lot if its not run in DEBUG mode and that this was a very quick test, here are the results:-

Everything on ram drive
Compilation speed: 5 secs
Debug compilation speed: 10 secs

Everything on HDD
Compilation speed: 5 secs
Debug compilation speed: 10 secs

So, surprisingly, using a high performance ram drive vs HHD doesn't seem to make a noticeable difference on my system. Memory caching in Windows 7 might play a factor. Not sure.

bigsofty

I would go for the SSD option if money permits. I have a couple of cheap Samsung SSD's in a RAID config, a slow large compile is about 20 secs, averaging about 5-10 secs for most compiles with Incredibuild though.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

mentalthink

Hi Bigsofty I found this:

http://gizmodo.com/5930747/these-super+cheap-ssds-should-convince-you-to-switch-storage

Well 250Gb 190$ but 128GB about 100$ I don´t look too much expensive.

They have one for 50$ whit 34Gb, but I think it´s too less for put OS and all the basic tools... We have to wait for a time... :rant: :rant: