|
1. There are very few purely interpretive languages today. They all precompile the source to some internal form, which is really very close to compile. Which is especially true in your test, where you have very short loop. Do you really think that FoxPro interprets every statement in your loop as it is encountered ? 2. I want to attract once again your attention to the fact that you trim *constant string* every time. Smart compiler will eliminate your entire loop and replace it with a single statement. Change number of repetitions from 500000 to 5000000. I will not be surprised if the timing will be exactly the same. 3. I dare remind you that you constantly leave software out of the scope of this discussion. You want to compare PowerPC speed to Pentium speed. But what you do actually compare is speed of RPG implementation in OS/400 environment on PowerPC to speed of FoxPro implementation in Windows environment on Pentium. Which is somewhat different thing, don't you think ? Try some other programming languages on OS/400 for a better perspective. Try C/C++ instead of RPG. Several years ago when RISC was first out I took some standard LinPack numerical benchmarks (they are all in C and with some massaging can be easily ported to OS/400) and ran them on PC and OS/400. Results were quite comparable. So I personally suspect BIF implementation in RPG can be better. You may ask RPG developers - maybe they will have some good answers - they could have good reasons to implement it this way. Alexei Pytel "Nathan M. Andelin" <nathanma@haaga.com To: <MIDRANGE-L@midrange.com> > cc: Sent by: Subject: Re: How are CPU Speed and Overall CPW owner-midrange-l@mi Related? drange.com 05/03/2001 12:25 PM Please respond to MIDRANGE-L > From: "Alexei Pytel" <pytel@us.ibm.com> > I can't understand your obsession with "artificial constraints". > It's much more complicated than that. I'll try to address your comments in a future post, but while I have your attention, I'll add a little more fuel to the fire. Foxpro is an interpreted language, and relatively slow. So what about a compiled language like Pascal? Consider the following Delphi code: procedure TForm1.Button1Click(Sender: TObject); var theString : String; theShorter : String; i : integer; timeNow : TDateTime; timeThen : TDateTime; timeDiff : Real; begin theShorter := 'TEST STRING '; timeThen := Now; for i := 0 to 500000 do begin theString := TrimAll(theShorter); end; timeNow := Now; timeDiff := timeNow - timeThen; stringBox.text := theString; timeBox.text := FloatToStr(timeDiff); end; *** My older version of Delphi didn't have a TrimAll() function. I had to write my own BIF: *** function TrimAll(const S: string): string; var I, L: Integer; begin L := Length(S); I := 1; while (I <= L) and (S[I] < #33) do Inc(I); if I > L then Result := '' else begin while (S[L] < #33) do Dec(L); Result := Copy(S, I, L - I + 1); end; end; Like the RPG code, this program TRIMS all BLANKS off a 50 byte string and assigns the result to another string variable. The difference is that the Intel based Pascal program runs 10 times faster. What is constraining the AS/400 CPU? Nathan. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.