Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparing AddItem and AddListItem
Message
De
07/12/1999 10:01:36
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00299195
Message ID:
00299732
Vues:
20
David-

>The only obvious thing to me is that the second combo is making 3 more object property dereferences (6 .NewItemId refs vs 3 .ListCount ref) in the loop.

Good point. So I checked it by assigning the .newitemid to a local var:
FOR lni = 1 TO 1000

	lnj = .NewItemID + 1
	.AddListItem( 'Color', lnj, 1 )
	.AddListItem( 'Red', lnj, 2 )

	.AddListItem( 'Style', lnj, 1 )
	.AddListItem( 'Dress', lnj, 2 )

	.AddListItem( 'Size', lnj, 1 )
	.AddListItem( 'Medium', lnj, 2 )

*!*		.AddListItem( 'Color', .NewItemID + 1, 1 )
*!*		.AddListItem( 'Red', .NewItemID, 2 )

*!*		.AddListItem( 'Style', .NewItemID, 1 )
*!*		.AddListItem( 'Dress', .NewItemID, 2 )

*!*		.AddListItem( 'Size', .NewItemID, 1 )
*!*		.AddListItem( 'Medium', .NewItemID, 2 )

NEXT lni
There was some improvement, but not much: 1.190 w/o the local var versus 1.165 w/ the local var.

In either case (AddListItem, or AddItem), I've always wished the column was the second parameter. Then, the last row could be assumed for column > 1. But, heck, that might slow things down even more.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform