Re: [fpc-pascal] Speed difference between intel/ppc on intel Mac

2008-09-07 Thread Jonas Maebe
On 07 Sep 2008, at 21:38, Micha Nelissen wrote: Jonas Maebe wrote: You can use -vd to have the compiler print out all compiler options it interprets (both from configuration files and from the command line). In general, to get the best code for an Intel Core family processor, use somethin

Re: [fpc-pascal] Speed difference between intel/ppc on intel Mac

2008-09-07 Thread Micha Nelissen
Jonas Maebe wrote: You can use -vd to have the compiler print out all compiler options it interprets (both from configuration files and from the command line). In general, to get the best code for an Intel Core family processor, use something like -O3ppentium4 -Cppentium4 -Cfsse2 i doubt it'

Re: [fpc-pascal] Speed difference between intel/ppc on intel Mac

2008-09-06 Thread Jonas Maebe
On 05 Sep 2008, at 20:07, Tom Verhoeff wrote: I have an Intel-based MacBook Pro. Until recently, I still used a PowerPC version of FPC. PowerPC code on this machine runs through (invisible) emulation. However, I upgraded now to FPC 2.2.2 for Intel on mac. And to my surprise one of my time-co

[fpc-pascal] Speed difference between intel/ppc on intel Mac

2008-09-05 Thread Tom Verhoeff
I have an Intel-based MacBook Pro. Until recently, I still used a PowerPC version of FPC. PowerPC code on this machine runs through (invisible) emulation. However, I upgraded now to FPC 2.2.2 for Intel on mac. And to my surprise one of my time-consuming apps is twice slower, instead of faster.

Re: [fpc-pascal] Speed

2007-10-31 Thread Jilani Khaldi
For example, what do Airplanes use? GNU? Ada compilers must be certified, so if you are developing software for avionics *you have* to write your software with a compiler certified for avionics development. JK ___ fpc-pascal maillist - fpc-pascal@l

Re: [fpc-pascal] Speed

2007-10-31 Thread Jonas Maebe
On 31 Oct 2007, at 19:11, L wrote: Further, it is unknown how well the GCC backend optimizes Ada language constructs as it is primarily designed for the C language. I assumed that people used not just GNU Ada compilers.. for serious work. But I'm not sure. For example, what do Airplanes u

Re: [fpc-pascal] Speed

2007-10-31 Thread L
> Further, it is unknown how well the GCC backend optimizes Ada > language constructs as it is primarily designed for the C language. I assumed that people used not just GNU Ada compilers.. for serious work. But I'm not sure. For example, what do Airplanes use? GNU? I'd laugh if Richard Stallman

Re: [fpc-pascal] Speed

2007-10-31 Thread Vinzent Hoefler
On Wednesday 31 October 2007 12:35, Daniël Mantione wrote: > Further, it is unknown how well the GCC backend optimizes Ada > language constructs as it is primarily designed for the C language. Well enough. In other words, optimization is about the same - given fairly equivalent code. The main d

Re: [fpc-pascal] Speed

2007-10-31 Thread Daniël Mantione
Op Wed, 31 Oct 2007, schreef Jilani Khaldi: > > > I hear the Intel C compilers and Fortran compilers and Ada compilers > > > are better > > > optimized for certain things since FPC/delphi are generally desinged > > > for GUI > > > programming. ;-) > > > > C/Fortran yes, Ada no; there exists no

Re: [fpc-pascal] Speed

2007-10-31 Thread Jilani Khaldi
I hear the Intel C compilers and Fortran compilers and Ada compilers are better optimized for certain things since FPC/delphi are generally desinged for GUI programming. ;-) C/Fortran yes, Ada no; there exists no Intel Ada compiler. False. There's no speed penalty for writing in Ada vs C. They

Re: [fpc-pascal] Speed

2007-10-31 Thread Jonas Maebe
On 31 Oct 2007, at 00:47, L wrote: And I'm sure you know you can always use GOTO statements when you really need speed out of loops Actually, in current FPC versions that will more often than not cause slowdowns, because the compiler cannot optimize as well when goto's are used. Jona

Re: [fpc-pascal] Speed

2007-10-30 Thread L
> If the code is more efficient with a "goto", this is sufficient to > justify its use. Or if the code is clearer, for example to avoid deep nesting... Or to make clean errors and debugging log files easier: exit; .// default //else error1: begin debugln('error1'); exit; end; error2 begin

Re: [fpc-pascal] Speed

2007-10-30 Thread mm
L a écrit : P.S. Where i can read tips about writing fast FP code? Also see some of the fastcode projects: http://www.fastcode.dk/fastcodeproject/fastcodeproject/index.htm And I'm sure you know you can always use GOTO statements when you really need speed out of loops :) As a matter of fa

Re: [fpc-pascal] Speed

2007-10-30 Thread mm
bartek a écrit : On Tuesday 30 October 2007 22:07:21 Valdas Jankūnas wrote: P.S. Where i can read tips about writing fast FP code? FP is no Java. You get what you write. If you don't use virtual functions in OO-code, there are no hidden performance killers. First identify the bottleneck in yo

Re: [fpc-pascal] Speed

2007-10-30 Thread L
> I hear the Intel C compilers and Fortran compilers and Ada compilers are better > optimized for certain things since FPC/delphi are generally desinged for GUI > programming. ;-) >> >> C/Fortran yes, Ada no; there exists no Intel Ada compiler. It is also >> false that FPC is slow because it has be

Re: [fpc-pascal] Speed

2007-10-30 Thread Daniël Mantione
Op Tue, 30 Oct 2007, schreef L: > > I think first code is faster than second, because in first code > > SubCalculate function is in calling function body? > > Actually some times local scope functions are slower because the variables > need > to be carried around since you are doing somewhat

Re: [fpc-pascal] Speed

2007-10-30 Thread L
> > P.S. Where i can read tips about writing fast FP code? Also see some of the fastcode projects: http://www.fastcode.dk/fastcodeproject/fastcodeproject/index.htm And I'm sure you know you can always use GOTO statements when you really need speed out of loops :) (not always, only if absolut

Re: [fpc-pascal] Speed

2007-10-30 Thread L
> I think first code is faster than second, because in first code > SubCalculate function is in calling function body? Actually some times local scope functions are slower because the variables need to be carried around since you are doing somewhat of a lexical closure. The local scope function

Re: [fpc-pascal] Speed

2007-10-30 Thread bartek
On Tuesday 30 October 2007 22:07:21 Valdas Jankūnas wrote: > L rašė: > > Here's one: profile your code! > > And where can you read how to do that? > > > > VALGRIND > > I processed my app trough "valgrind -v --tool=callgrind ./my_app", > opened generated report with Kcachegrid and vi

Re: [fpc-pascal] Speed

2007-10-30 Thread Valdas Jankūnas
L rašė: Here's one: profile your code! And where can you read how to do that? VALGRIND I processed my app trough "valgrind -v --tool=callgrind ./my_app", opened generated report with Kcachegrid and viewed how many times called some procedures and etc. Sorry for stupid question: i have n

Re: [fpc-pascal] Speed

2007-10-30 Thread L
Here's one: profile your code! >>> And where can you read how to do that? VALGRIND ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Speed

2007-10-30 Thread Valdas Jankūnas
Mattias Gärtner rašė: Zitat von Krishna <[EMAIL PROTECTED]>: On 10/30/07, Mattias Gärtner <[EMAIL PROTECTED]> wrote: Zitat von Krishna <[EMAIL PROTECTED]>: On 10/30/07, Valdas JankÅ«nas <[EMAIL PROTECTED]> wrote: P.S. Where i can read tips about writing fast FP code? Here's one: profile

Re: [fpc-pascal] Speed

2007-10-30 Thread Mattias Gärtner
Zitat von Krishna <[EMAIL PROTECTED]>: > On 10/30/07, Mattias Gärtner <[EMAIL PROTECTED]> wrote: > > Zitat von Krishna <[EMAIL PROTECTED]>: > > > > > On 10/30/07, Valdas Jankūnas <[EMAIL PROTECTED]> wrote: > > > > > > > P.S. Where i can read tips about writing fast FP code? > > > > > > > > > > H

Re: [fpc-pascal] Speed

2007-10-30 Thread Krishna
On 10/30/07, Mattias Gärtner <[EMAIL PROTECTED]> wrote: > Zitat von Krishna <[EMAIL PROTECTED]>: > > > On 10/30/07, Valdas Jankūnas <[EMAIL PROTECTED]> wrote: > > > > > P.S. Where i can read tips about writing fast FP code? > > > > > > > Here's one: profile your code! > > And where can you read how

Re: [fpc-pascal] Speed

2007-10-30 Thread Mattias Gärtner
Zitat von Krishna <[EMAIL PROTECTED]>: > On 10/30/07, Valdas Jankūnas <[EMAIL PROTECTED]> wrote: > > > P.S. Where i can read tips about writing fast FP code? > > > > Here's one: profile your code! And where can you read how to do that? Mattias ___ fp

Re: [fpc-pascal] Speed

2007-10-30 Thread Krishna
On 10/30/07, Valdas Jankūnas <[EMAIL PROTECTED]> wrote: > P.S. Where i can read tips about writing fast FP code? > Here's one: profile your code! Cheers, -Krishna -- One reason that life is complex is that it has a real part and an imaginary part -Andrew Koenig ___

[fpc-pascal] Speed

2007-10-30 Thread Valdas Jankūnas
Now i write program, that program made extensive calculations. And i want write fast code. Question about executing speed: first code- function Calculate1: Extended; function SubCalculate: Extended; begin ... end; begin ... ..:=SubCalculate; ... end; second code- function

Re: [fpc-pascal] speed of real calculations

2006-10-18 Thread Jonas Maebe
On 18 okt 2006, at 12:38, Marc Santhoff wrote: Ah, this was the missing part. I have thought all of this was implemented only inside the compiler itself ... It is, except for x86 where the compiler is not involved with the precision used by the FPU since there are no different opcodes. J

Re: [fpc-pascal] speed of real calculations

2006-10-18 Thread Marc Santhoff
Am Mittwoch, den 18.10.2006, 11:57 +0200 schrieb Jonas Maebe: > On 18 okt 2006, at 11:20, Marc Santhoff wrote: > > > Divisions do make a difference for me. How can this setting be > > made, is > > there a compiler sitch involved or some symbol to define? > > http://community.freepascal.org:1000

Re: [fpc-pascal] speed of real calculations

2006-10-18 Thread Jonas Maebe
On 18 okt 2006, at 11:20, Marc Santhoff wrote: Divisions do make a difference for me. How can this setting be made, is there a compiler sitch involved or some symbol to define? http://community.freepascal.org:1/docs-html/rtl/math/ setprecisionmode.html Always check the result, since

Re: [fpc-pascal] speed of real calculations

2006-10-18 Thread Marc Santhoff
Am Mittwoch, den 18.10.2006, 09:54 +0200 schrieb Florian Klaempfl: > Jonas Maebe wrote: > > > > On 18 okt 2006, at 08:31, Marc Santhoff wrote: > > > >> is anyone aware of or has done a calculations speed comparison for the > >> four float types (single, double, extended, comp)? > > > > For the x

Re: [fpc-pascal] speed of real calculations

2006-10-18 Thread Florian Klaempfl
Jonas Maebe wrote: > > On 18 okt 2006, at 08:31, Marc Santhoff wrote: > >> is anyone aware of or has done a calculations speed comparison for the >> four float types (single, double, extended, comp)? > > For the x87, the only difference can come from cache misses/hits due to > the different size

Re: [fpc-pascal] speed of real calculations

2006-10-18 Thread Jonas Maebe
On 18 okt 2006, at 08:31, Marc Santhoff wrote: is anyone aware of or has done a calculations speed comparison for the four float types (single, double, extended, comp)? For the x87, the only difference can come from cache misses/hits due to the different sizes they take up in memory, becaus

[fpc-pascal] speed of real calculations

2006-10-17 Thread Marc Santhoff
Hi, is anyone aware of or has done a calculations speed comparison for the four float types (single, double, extended, comp)? I'm most interested in the first rules of arithmetic. TIA, Marc ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Speed question for strings

2005-11-19 Thread L505
> The first string is always long, so you are doing twice adding a small > string to a long string. This causes much heap fragmentation. > > Try result:= result + (Line + #13#10); > or > > Line := Line + #13#10; > Result := Result + Line; Ahh that will probably do the trick. I'll let you know. >

Re: [fpc-pascal] Speed question for strings

2005-11-19 Thread L505
- Original Message - From: "Peter Vreman" <[EMAIL PROTECTED]> To: "FPC-Pascal users discussions" Sent: Saturday, November 19, 2005 1:47 AM Subject: Re: [fpc-pascal] Speed question for strings > At 09:46 19-11-2005, you wrote: > > > L wrote: >

Re: [fpc-pascal] Speed question for strings

2005-11-19 Thread Vincent Snijders
L505 wrote: L wrote: Why is the first and third example *so* much faster than the second example? Significantly faster. Because you doubled the number of string concatenations. Vincent. Right, but it's not twice as slow :-) Worse... It's at least 50-100 times slower. Weird. I will hav

Re: [fpc-pascal] Speed question for strings

2005-11-19 Thread Peter Vreman
At 09:46 19-11-2005, you wrote: > L wrote: > > Why is the first and third example *so* much faster than the second example? > > Significantly faster. > > > > Because you doubled the number of string concatenations. > > Vincent. Right, but it's not twice as slow :-) Worse... It's at least 50-1

Re: [fpc-pascal] Speed question for strings

2005-11-19 Thread L505
> L wrote: > > Why is the first and third example *so* much faster than the second example? > > Significantly faster. > > > > Because you doubled the number of string concatenations. > > Vincent. Right, but it's not twice as slow :-) Worse... It's at least 50-100 times slower. Weird. I will hav

Re: [fpc-pascal] Speed question for strings

2005-11-19 Thread Vincent Snijders
L wrote: Why is the first and third example *so* much faster than the second example? Significantly faster. Because you doubled the number of string concatenations. Vincent. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.fr

[fpc-pascal] Speed question for strings

2005-11-18 Thread L
Why is the first and third example *so* much faster than the second example? Significantly faster. There's really not that much difference between the string concatenation. //Example 1: (seems fast) function StrLoadFile_test1(FileName: string): string; var F: text; c: char; str1,Line: stri