Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ISSUE or BUG: LEN,VARTYPE,TYPE optimization
Message
From
20/10/2005 18:51:32
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
ISSUE or BUG: LEN,VARTYPE,TYPE optimization
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01060928
Message ID:
01060928
Views:
70
Observed:
LEN(),VARTYPE(),TYPE() and ???? are optimized
respect to a field.

Expected:
they should be also optimized for a variable too:
CLEAR
CREATE cursor Test (longString  W)
APPEND BLANK
REPLACE longString WITH REPLICATE('aaaaaaaaaaaaaaaa',1000000)
SCATTER MEMVAR memo  

	t1=SECONDS()
	FOR k=1 TO 50
		=len(longString)
	NEXT
	? "len(longString) =",SECONDS()-t1

	t1=SECONDS()
	FOR k=1 TO 50
		=len(Test.longString)
	NEXT
	? "len(longString) =",SECONDS()-t1
	
	t1=SECONDS()
	FOR k=1 TO 50
		=len(m.longString)
	NEXT
	? "len(m.longString) =",SECONDS()-t1

	t1=SECONDS()
	FOR k=1 TO 50
		=VARTYPE(longString)
	NEXT
	? "VARTYPE(longString) =",SECONDS()-t1

	t1=SECONDS()
	FOR k=1 TO 50
		=VARTYPE(Test.longString)
	NEXT
	? "VARTYPE(longString) =",SECONDS()-t1
	
	t1=SECONDS()
	FOR k=1 TO 50
		=VARTYPE(m.longString)
	NEXT
	? "VARTYPE(m.longString) =",SECONDS()-t1
Reply
Map
View

Click here to load this message in the networking platform