Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AS Clause
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00409807
Message ID:
00409984
Views:
30
>>>Variables are faster than literals?!? Wow! That surprises me.
>>
>>Take with a rather large grain of salt. Remember, I haven't tested this since 2.6, so it may have changed. Further, as I recall the difference was miniscule.
>
>Thanks. I was just trying to imagine the assembler code behind it and it didn't compute. But my assembler days are far behind me! Last worked with MASM 5., revising PC Mag utilities.

Being an "old" bithead < g > myself, that was my initial reaction. As I recall, what brought it about was a stituation where, because of the limitations of 2.6 in being able to to handle a rather complex query because of its length (it couldn't compile), I was forced to use a variable to replace a literal that occurred in several spots in the query. Out of sheer curiousity, I did a test with a shorter query, but with multiple instances of the variable and the literal, and, to my surprise, the variable seemed faster. I had, like you, expected the opposite. Overall, however, the difference was in the 1000ths of a second, so it ain't something that folks should go running off and doing thinking that it will help their queries.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform