NO

Author Topic: Why compile Pelles C so slow?  (Read 26512 times)

linnar

  • Guest
Re: Why compile Pelles C so slow?
« Reply #30 on: September 11, 2011, 12:23:56 AM »
linnar... are you reading the instructions Timo and I have given you?

*There is no executable file*... it is a DLL file that is placed in a special folder so that it is loaded by POIDE (Pelles C editor) and works from inside the editor... hense the name "Addin"...

Go take a look at my QuickFlags addin... there's no exe file there, either.
Well, I've read the link several times.
 I'm not one hundred percent in English, I can sometimes misunderstand. I understand now that it's dll file to be included. I thought it was a exe file.
 Sorry for this!

 I'll try it again!

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: Why compile Pelles C so slow?
« Reply #31 on: September 11, 2011, 12:35:10 AM »
If in doubt check the project settings for the type of executable to be created by it.

It is even easier, if you just build the project.
---
Stefan

Proud member of the UltraDefrag Development Team

linnar

  • Guest
Re: Why compile Pelles C so slow?
« Reply #32 on: September 11, 2011, 12:57:01 AM »
Now it works!
Thanks to you who built this fine little program, and thanks for your help!

I get some strange error messages but it may be because I have included some other lib to my program to work.
Also need to change / add some other compilation instructions.

A rebuild took about 10 seconds. (before 120 sec)

To be continued ....

linnar

  • Guest
Re: Why compile Pelles C so slow?
« Reply #33 on: September 11, 2011, 01:41:30 AM »
There are some problems left to solve! I know, for example, not what all the acronyms in "SelCompiler" means.

I'm not getting the icon in the program.
Get new error messages that Shell.lib is when I have it with, etc.


A bug in "SelCompiler":
When you press the "Delete" in the Options but regrets it and press the "Cancel" it is still all erased when you open the "Sel Compiler" next time.
Next time I mess with this, I enter everything again ....   >:(

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Why compile Pelles C so slow?
« Reply #34 on: September 11, 2011, 09:12:53 AM »
Quote
I know, for example, not what all the acronyms in "SelCompiler" means.
These are variables for poide.exe and pomake.exe:
CC:        compiler executable
CCFLAGS:   compiler commandline options
AS:        assembler executable
ASFLAGS:   assembler commandline options
LINK:      linker executable
LINKFLAGS: linker commandline options
RC:        resource compiler executable
RCFLAGS:   resource compiler commandline options
AR:        library manager executable
ARFLAGS:   library manager commandline options
INCLUDE:   include search paths
LIB:       library search paths

Title:     name or title for SelCompiler option block
            - name when using New button
            - title when using Save button

Quote
A bug in "SelCompiler":
When you press the "Delete" in the Options but regrets it and press the "Cancel" it is still all erased when you open the "Sel Compiler" next time.
Cancel button removed.
« Last Edit: September 11, 2011, 10:38:23 AM by timovjl »
May the source be with you

linnar

  • Guest
Re: Why compile Pelles C so slow?
« Reply #35 on: September 11, 2011, 02:18:58 PM »
@timovjl
Thanks for your nice and quick response. Nice to have developers that listen to users, and change it as noted.
Great!

linnar

  • Guest
Re: Why compile Pelles C so slow?
« Reply #36 on: September 12, 2011, 11:20:52 AM »
Is this what is the answer to the hugely short compilation time?

From LccWin32 website:
The 'windows.h' file, is only about 400K, instead of more than 4MB in other systems. This speeds compilation enormously.


source:
http://www.q-software-solutions.de/products/lcc-win32/components.shtml

LccWin32 website:
http://www.q-software-solutions.de/index.shtml



CommonTater

  • Guest
Re: Why compile Pelles C so slow?
« Reply #37 on: September 12, 2011, 11:27:04 AM »
The windows.h with Pelles C is only about  3k.  Mind you it includes a lot of other files...

There is a "trim down"...  #define WIN32_LEAN_AND_MEAN ... which loads only the most basic of the sub-headers but it still probably totals a megabyte or so. 

Yes this will make a difference... but most likely the largest difference is that Pelles C is an optimizing compiler where LCC is not.  Reworking and optimizing source code takes time.



JohnF

  • Guest
Re: Why compile Pelles C so slow?
« Reply #38 on: September 12, 2011, 12:17:53 PM »
Once I tested Lcc-Win32 using the PellesC headers, Lcc-Win32 was then the same speed as PellesC.

It was a long time ago however.

John

linnar

  • Guest
Re: Why compile Pelles C so slow?
« Reply #39 on: September 12, 2011, 12:55:44 PM »
The windows.h with Pelles C is only about  3k.  Mind you it includes a lot of other files...

There is a "trim down"...  #define WIN32_LEAN_AND_MEAN ... which loads only the most basic of the sub-headers but it still probably totals a megabyte or so. 

Yes this will make a difference... but most likely the largest difference is that Pelles C is an optimizing compiler where LCC is not.  Reworking and optimizing source code takes time.

LccWin32 has an optimization option (-O). I have not used it on my big projelt of 1.2 Mb. When I get time I will test the flag and see if it takes longer.

linnar

  • Guest
Re: Why compile Pelles C so slow?
« Reply #40 on: September 12, 2011, 01:00:04 PM »
Once I tested Lcc-Win32 using the PellesC headers, Lcc-Win32 was then the same speed as PellesC.

It was a long time ago however.

John
When I compare the compilation time for smaller projects, the difference is not great. A code of 10k takes under 0.1 seconds in LccWin32 and one sec in Pelle-C.
LccWin32 always print compilation time but it does not Pelle-C so it is difficult to measure the compilation time for Pelle's C-exactly when the time is down to one second.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Why compile Pelles C so slow?
« Reply #41 on: September 12, 2011, 07:01:54 PM »
Can this help timing?
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>

int main(int argc, char **argv)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
FILETIME ftCreationTime, ftExitTime, ftKernelTime, ftUserTime;
SYSTEMTIME stTime;
long long ll, *pLL1, *pLL2;
char *lpszCmdLine, *pChar;

pChar = GetCommandLine();
if (*pChar == '"') {
pChar++;
while (*pChar && *pChar != '"')
pChar++;
pChar++;
} else {
while (*pChar && *pChar != ' ')
pChar++;
}
while (*pChar && *pChar <= ' ')
pChar++;

ftExitTime.dwHighDateTime = 0;
ftExitTime.dwLowDateTime = 0;
memset(&si, 0, sizeof(si));
si.cb = sizeof(STARTUPINFO);
if (CreateProcess(NULL, pChar, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi))
{
WaitForSingleObject(pi.hProcess, INFINITE);
GetProcessTimes(pi.hProcess, &ftCreationTime, &ftExitTime, &ftKernelTime, &ftUserTime);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
ll = *((long long*)&ftExitTime) - *((long long*)&ftCreationTime);
FileTimeToSystemTime(((FILETIME*)&ll), &stTime);
printf("%d:%d.%d %lld\n", stTime.wMinute, stTime.wSecond, stTime.wMilliseconds, ll);
} else printf("error\n");
return 0;
}
Or AddIn ?
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <addin.h>

static HWND g_hwndMain = NULL;

BOOL WINAPI DllMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved)
{
return TRUE;
}

ADDINAPI BOOL WINAPI AddInMain(HWND hwnd, ADDIN_EVENT eEvent)
{
TCHAR szTmp[100];
static DWORD dwStart, dwEnd;

switch (eEvent)
{
case AIE_APP_CREATE:
g_hwndMain = hwnd;
return TRUE;

case AIE_PRJ_STARTBUILD:
dwStart = GetTickCount();
return TRUE;

case AIE_PRJ_ENDBUILD:
dwEnd = GetTickCount();
wsprintf(szTmp, "%dms", dwEnd - dwStart);
AddIn_WriteOutput(g_hwndMain, szTmp);
return TRUE;
default:
return TRUE;
}
}
« Last Edit: September 12, 2011, 09:56:38 PM by timovjl »
May the source be with you

linnar

  • Guest
Re: Why compile Pelles C so slow?
« Reply #42 on: September 12, 2011, 11:26:01 PM »
@timovjl

Wow, AddIn version I like  ;) !

 Right now I am busy with other things, but I will try your suggestion to code when the time for there.

 (Developers' right now the graphical shell to my accounting software. )



 EDIT:
 Got a few minutes ago found out that I can get the source code to LccWin32 editor "Wedit" if I want to develop it into something more modern.   8)