[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-atl
Subject:    Re: Back to collections
From:       Chris Sells <csells () SELLSBROTHERS ! COM>
Date:       1998-09-30 21:29:06
[Download RAW message or body]


The performance gains would be nice, if the VB team hadn't decided, release
after release, to use 1 when calling IEnumVARIANT::Next. In that case,
you're actually paying the price of converting to and from the VARIANT type
instead of having direct access to the type, as you would via a call to
Item. <sigh>

Chris Sells
http://www.sellsbrothers.com

> -----Original Message-----
> From: ATL - Active Template Library [mailto:ATL@DISCUSS.MICROSOFT.COM]On
> Behalf Of CNelson@SYMANTEC.COM
> Sent: Wednesday, September 30, 1998 2:20 PM
> To: ATL@DISCUSS.MICROSOFT.COM
> Subject: Re: Back to collections
>
>
> The code mentioned below would work but not very efficiently
> (which was I recall
> the whole point for the _NewEnum property to begin with). Each
> evaluation of the
> for-construct is a propget, save to tempvar, and comparison. Then each
> strCollection(i) is a method or propget, copy or setref, etc...
>
> Even in InProc the performance on substantially large collections
> of objects or
> data values the standard for-loop rather than for-each
> significantly reduces
> performance. It is extremely poor for out-of-proc servers and
> absolutely horrid
> on DCOM servers running on the wire.
>
> Unless I'm mistaken all you give up by using the For-Each construct is
> guaranteed order since it is not defined on the IEnumXXXX interface. Most
> collections I have written end up supporting the same 1..n
> ordering anyway but I
> don't believe it is guaranteed. Either way the performance gains are
> substantial, especially for large collections, nested loops, etc.
>
> Another two cents (flush)
>
> Craig
>
>
> -----Original Message-----
> From:   George Mladenov <mladenov@PLX.COM>
> Sent:   Wednesday, September 30, 1998 1:58 PM
> To:     ATL@DISCUSS.MICROSOFT.COM
> Subject:        Re: Back to collections
>
> In VB _NewEnum is used in the For Each ... loop. Count and Item are called
> in a "normal" loop:
> For I = 1 To strCollection.Count
>   'Item called implicitly if its dispid is DISPID_VALUE.
>   str = strCollection(I)
> Next I
>
> I used to wonder when is VB calling _NewEnum :-).
>
>
>
> -----Original Message-----
> From: Max Walshe <maxw@BARACING.CO.UK>
> Date: Wednesday, September 30, 1998 7:40 AM
> Subject: Back to collections
>
>
> >My strings are being nicely enumerated via _NewEnum now but
> >under what circumstances would the Count and Item methods be called (if
> >at all) from VB?
> >
> >Regards
> >
> >Max
> >
>
> ----------------------------------------------------------------
> Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
> contains important info including how to unsubscribe.  Save time, search
> the archives at http://discuss.microsoft.com/archives/index.html
>  << File: TXT1.TXT >>
>
> ----------------------------------------------------------------
> Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
> contains important info including how to unsubscribe.  Save time, search
> the archives at http://discuss.microsoft.com/archives/index.html
>

----------------------------------------------------------------
Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic