Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Speed
Message
From
04/02/2012 12:26:54
 
 
To
04/02/2012 12:21:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01534425
Message ID:
01534446
Views:
102
I|'d expect VB.NET to give pretty much identical results - both languages would compile to the same IL code....

>Thanks Viv. Was to be expected for anything C :) Would this be the same for VB.Net since they run off the same underlying platform?
>
>
>>>Hi All,
>>>
>>>I am doing a raw speed test on some very simple operations to compare basic VFP operations with another language. Would some of you care to do a similar test against another language of your choice? e.g. Python, PHP, VB.Net, whatever. I am looking for VFP speed vs. language_of_your_choice speed on the same machine. Here are two simple tests manipulating some numbers and building a string in VFP
>>>
>>>
>>>
>>>CLEAR
>>>tStartTime = SECONDS()
>>>ta=0
>>>FOR i = 1 TO 1000000
>>>  ta = Log(i) + Cos(i) + Sin(i) + Log(i) + exp(i)
>>>next  
>>>? SECONDS() - tStartTime 
>>>
>>>*
>>>
>>>tStartTime = SECONDS()
>>>ta = ""
>>>FOR i = 1 TO 1000000
>>>  ta = ta + "xx"
>>>next  
>>>? SECONDS() - tStartTime 
>>>
>>
>>On a fairly old machine:
>>VFP : 1.298 seconds and .898 seconds.
>>
>>C# (code below) : 480 milliseconds and 25 milliseconds
static void Main(string[] args)
>>        {
>>            Stopwatch sw = new Stopwatch();
>>            sw.Start();
>>            double ta = 0;
>>            for (int i = 0; i < 1000000; i++)
>>            {
>>                ta = Math.Log(i) + Math.Cos(i) + Math.Sin(i) + Math.Log(i) + Math.Exp(i);
>>            }
>>       
>>            Console.WriteLine("Milliseconds: {0}", sw.ElapsedMilliseconds);
>>            sw.Reset();
>>            sw.Start();
>>            StringBuilder sb = new StringBuilder();
>>            for (int i = 0; i < 1000000; i++)
>>            {
>>                sb.Append("xx");
>>            }
>>            string s = sb.ToString();
>>            Console.WriteLine("Milliseconds {0}", sw.ElapsedMilliseconds);
>>            Console.ReadLine();
>>        }
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform