Page 3 of 3

Re: Why does it take time to compile?

Posted: Thu Oct 18, 2012 11:44 am
by CONVERT
Hello,

When I add CreateMenu, the compilation becomes very slow.
I remove CreateMenu, the compilation becomes very fast.

My example is too large to be put here. I'll try to write a little test code to show that. May be I'll find what's wrong in my code...

Re: Why does it take time to compile?

Posted: Thu Oct 18, 2012 12:53 pm
by Fred
Do you have MS security essential or another anti-virus software ? if yes try to disable them to see if it impact the compile time.

Re: Why does it take time to compile?

Posted: Thu Oct 18, 2012 7:50 pm
by CONVERT
Yes, I have MS Security Essential.

I disabled the real-time protection, and the compilation became fast even with CreateMenu. I enabled the real-time protection, and the compilation became slow.

When I say compilation, it is F5 with Debugger enabled. If I create an executable, the compilation is fast, even with real-time protection enabled.

Thanks, Fred.

Jean.

Re: Why does it take time to compile?

Posted: Thu Oct 18, 2012 9:46 pm
by CONVERT
If I set my temporary directory ( C:\Users\Jean\AppData\Local\Temp ) in the excluded directory in MS Security Essential, the compilation runs fast, even F5 + Debugger.

I tried the following things without success. For example
excluding these processes:
C:\Program Files\PureBasic\Compilers\pbcompiler.exe; not good
C:\Users\Jean\AppData\Local\Temp\PureBasic_Compilation0.exe; not good
C:\Program Files\PureBasic\PureBasic.exe; not good

Setting the current directory in the option of the compiler to the directory where there is the pb source, and setting this directory in the excluded directory in MS Security Essential. Not good.
Enabling "Create temporary executable in the source directory", and excluding the source directory in MS Security Essential, or excluding the process source\directory\PureBasic_Compilation0.exe. Not good.
File / Preferences / Compiler / Default. I set the current directory in the option of the compiler to the directory where there is the pb source, and setting this directory in the excluded directory in MS Security Essential. Not good too.

The only solution I found is to let all these options in blank, and set my temporary directory ( C:\Users\Jean\AppData\Local\Temp ) in the excluded directory in MS Security Essential. In this case, F5 + Debugger runs fast.

It is not very safe to let the AppData\Local\Temp in the excluded directory in MS Security Essential. I remove it when I do not compile...

Re: Why does it take time to compile?

Posted: Fri Oct 19, 2012 7:38 am
by Danilo
CONVERT wrote:It is not very safe to let the AppData\Local\Temp in the excluded directory in MS Security Essential. I remove it when I do not compile...
Try this. It also excludes the assembler, linker etc. (the linker creates executable in TEMP, which might be the reason it is scanned more than usual)
and exclude not the whole TEMP but TEMP\PureBasic_Compilation0.exe to TEMP\PureBasic_Compilation9.exe for example.

Make sure you add the exclusions to 'Excluded Processes'

For your project/file, set the (default) compiler option "[X] create temporary executable in the source directory"

Re: Why does it take time to compile?

Posted: Fri Oct 19, 2012 6:11 pm
by CONVERT
Thanks Danilo.

I tried what you wrote. It did not not change anything.

I emptied my temp directory and did F5 with debugger, to see what happens in the temp directory. It seems it is a little more complicated.

A new directory appears, changing its name at every run: Temp\Purebasic19853685, Temp\Purebasic20121383 etc. I did not find a rule in theses numbers. This directory disappears at the end.

This new directory contains plenty of .lib, .asm, .rc, .res, or without suffixe. They come from Purebasic (Gadget.lib, Image.lib, ImagePlugin.lib, Manifest, Map.lib, etc.).

It creates also a TMP file Temp\~12EF230.TMP changing at every run. It disappears at the end.

It creates Temp\PB_EditorOutput.pb and Temp\PureBasic_Compilation0.exe, which remain after the compilation. PureBasic_Compilation0.exe has the same size as ~12EF230.TMP. I suppose ~12EF230.TMP is renamed to PureBasic_Compilation0.exe at the end.

If I set the (default) compiler option "[X] create temporary executable in the source directory", PureBasic_Compilation0.exe is created in the source directory instead of Temp directory. But the slowing compilation remains.