Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP vs Other languages (Python/Ruby)
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01511347
Message ID:
01511377
Views:
96
Hi Nick,

using your code, vs. the Python code used by John Fabiani, but modified to be identical in function to your code, I get (on the same, 5-year old hardware, Windows 7 machine):

VFP: 4.61
Python 2.6: 3.15

If I wanted to go 3 to 5 times faster, I could have run Pypy (they aren't through optimizing the JIT yet, and expect it to end up 10 to 20 times faster than CPython). (Pypy is a python interpreter compiled in python, and then JIT'd to native code, or to CLR, or to JVM).

All that said, everything I've read says "it's the algorithm, not the language."

The exception is on underpowered processors (think: smartphones, tablets). There, a combination of memory utilization and speed of the JIT are key. That's why folks either write for devices in Java (or Obj-C in iOS) or in Javascript (the various JITs are a minimum of 20 times faster than they were 5 years ago, up to 50x faster). That's also why Pypy will be (and is, in alpha form) on devices.

Just as in .Net, the key to spiffy visual elements is concurrent processing in some form (there are religious wars over what form of concurrent processing is best -- of course, it's always the kind supported by the writer). VFP is pretty unique in that it cheats on how the UI is drawn, rather than by using concurrent processing, which wasn't much of an option back when.

Anyway: I wouldn't chose on speed of execution. What the criteria are for you (ease of programming, marketability, Enterprise requirements, how it feels, strength of community, etc.) you have to decide. I can't imagine speed of execution being one of them, given the options that most languages have (Pypy, e.g., is already faster than JVM languages, generally). Another reason not to look at speed: history. In 1992-3, I had discussions with a Fox guru, and we decided that despite the fact that FP 1.0 could barely run on a basic IBM XT of the time, and that processing demands would only grow as true windowing applications took hold, the best bet was that computers would grow in capability to handle the demand. That has turned out to be the case, of course. I don't see any reason to think otherwise now.

Hank

>Hi All,
>
>Not really a Fox question specifically but thought someone here might have an idea on this.
>
>I am wondering just how code execution speed of VFP compares to other languages such as Python and Ruby? Take for example the following 10million times loop:
>
>nStart = SECONDS()
>a = 0
>b = RAND()
>FOR x = 1 TO 10000000
>	a = a + b
>NEXT
>nStop = SECONDS()
>? nStop-nStart, X, a
>
>
>This runs on my machine in VFP in 2.4secs. Any idea how fast it would run in either of the alternative languages?
>
>Thanks,
Previous
Reply
Map
View

Click here to load this message in the networking platform