Hi Cory, In the C++ sample, you are passing the rect by value, so you are saving a copy in the list. In C# a reference to the object is used, so there is no copy-construction overhead. You can change the list<rect> to a list<rect*>, but this way you have to manage the memory by yourlself. [] Mello Cory Nelson wrote: Just got done installing the VS.NET 2005 preview and did a small test.I compared an ArrayList of Rectangles to a List<Rectangle>, and timed inserting 1mil rects into each. I also wrote an equivalent c++ app. Got some interesting results: ArrayList: 265ms List<Rectangle>: 62ms list<rect>: 141ms So it seems with generics .NET is finally faster than c++ (at least, in this case). Esta mensagem foi verificada pelo E-mail Protegido Terra. Scan engine: VirusScan / Atualizado em 10/05/2004 / Versão: 1.5.2 Proteja o seu e-mail Terra: http://www.emailprotegido.terra.com.br/ |
- [Mono-list] offtopic, but cool Cory Nelson
- Re: [Mono-list] offtopic, but cool Cesar Mello
- Re: [Mono-list] offtopic, but cool Cory Nelson
- Re: [Mono-list] offtopic, but cool Cesar Mello
- Re: [Mono-list] offtopic, but cool Lluis Sanchez
- RE: [Mono-list] offtopic, but cool Dan
- Re: [Mono-list] offtopic, but cool Cory Nelson
- Re: [Mono-list] offtopic, but cool Jonathan Pryor
- Re: [Mono-list] offtopic, but cool Cory Nelson