Re: [fpc-pascal] put data to stdout (fpc vs. gcc)

2007-06-13 Thread Daniƫl Mantione
Op Wed, 13 Jun 2007, schreef Catalin Zamfir Alexandru: > Guess because you're using inc(count) which may tell the compiler to use a > specific procedure, specific procedure that may have its own hidden > variables. > > Use count := count + 1; and see what happens. This way you're not using th

Re: [fpc-pascal] put data to stdout (fpc vs. gcc)

2007-06-13 Thread Jonas Maebe
On 13 jun 2007, at 10:56, [EMAIL PROTECTED] wrote: The problem: The fpc-based program is explicit slower than the c- based program. My questions: Why is it so? Is it possible to avoid the problem? I guess it's the single to string conversion. This routine is very complex and not optimized

Re: [fpc-pascal] put data to stdout (fpc vs. gcc)

2007-06-13 Thread Henry Vermaak
On 13/06/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi I wrote two programs one in C and one in Freepascal. The program read a variable of a library and write it to stdout. I will put it into a file: ("#: ./dataprog > file.dat"). I use "printf" in the C and "writeln" in Freepascal. Th

Re: [fpc-pascal] put data to stdout (fpc vs. gcc)

2007-06-13 Thread Catalin Zamfir Alexandru
Plus, you may have GCC with optimization flags on, due to your Linux system [for example Gentoo] - whily FPC may be compiling its programs in the normal, unoptimized way. This also may be a problem. Check it. On Wednesday 13 June 2007 11:56, [EMAIL PROTECTED] wrote: > Hi > > I wrote two programs

Re: [fpc-pascal] put data to stdout (fpc vs. gcc)

2007-06-13 Thread Catalin Zamfir Alexandru
Guess because you're using inc(count) which may tell the compiler to use a specific procedure, specific procedure that may have its own hidden variables. Use count := count + 1; and see what happens. This way you're not using the inc() procedure that may be specific to the system unit. On Wedn

[fpc-pascal] put data to stdout (fpc vs. gcc)

2007-06-13 Thread fpc
Hi I wrote two programs one in C and one in Freepascal. The program read a variable of a library and write it to stdout. I will put it into a file: ("#: ./dataprog > file.dat"). I use "printf" in the C and "writeln" in Freepascal. The problem: The fpc-based program is explicit slower than the