| foreach( item i in array) vs for( int i = 0; i < array.Length; i++ ) (3 replies) |
| microsoft.public.dotnet.framework.performance |
| I have heard that the C# compiler / .Net JIT is optimized to handle this pattern for iterating over a System.Collections collection: MyType[] myTypes new MyType[ 100 ]; // code to fill collection ommitted ... .... for( int i 0; i al.Length; i ) { doSomething( myTypes[ i ] ); } Question : Will this optimize identically: foreach( MyType myType in myTypes ) { doSomething( myType ); } We have a lot of... |
|
| Bad Perf Allocating tons of Small Objects (7 replies) |
| microsoft.public.dotnet.framework.performance |
| I have a problem... We have a prototype we are working on where we are reading through an entire file and as each element of the file is read we are creating a new object. The objects are small but we have millions of them. The performance to load and create these objects in a loop is horrible. Watching the perf counters we are spending a great deal of time in the GC as the objects are created... ... |
|
| string parameter passing efficiency (4 replies) |
| microsoft.public.dotnet.framework.performance |
| ..NET expert I was wondering when you pass a string parameter into a function in C# (without the use of 'ref'), does .NET framework always creates a copy of it on the other side? Or does it employ something like copy on the write only algorithm? If former, is it really efficient? So if I need to pass a potentially large string around, should I try to use 'TextReader' like this: void SomeFunc() { s... |
|
| Page.Cache question (4 replies) |
| microsoft.public.dotnet.framework.performance |
| I want to load a bunch of data from the database, cache it in memory and have it accessible from all pages in an application. In VB6/COM I used shared properties for this, but I am not sure what is the best method to use in ASP.NET. Option 1: serialize the dataset and store in the page cache Option 2: store the contents of the dataset in a collection, serialize it and store in the page cache Optio... |
|
| Problem enumerating derived classes (probably missing the obvious) (2 replies) |
| microsoft.public.dotnet.framework.performance |
| Hey all, I've got a class "clsDictionaryItems" that inherits NameObjectCollectionBase. I want to make a strongly typed collection that holds instances of "clsDictionaryItem". Populating the collection is no problem, and I can enumerate using "For x 0 to DictionaryItems.Count 1", but when I try to use Dim l clsDI as clsDictionaryItem For Each l clsDI In DictionaryItems .... Next I always get an Inv... |
|
| Threadpooling Problem (3 replies) |
| microsoft.public.dotnet.framework.performance |
| I am an old VB user. I am a great problem solver, but Multithreading is new to me. I am writing a web service. I want to handle client requests, each on a new thread. Unfortunately, all thread pooling, or multi threading examples I see do not show how to return a value. They all fire subs, not functions. Can anyone point me to some sample code that shows how to have a web service do some work and ... |
|
| getting the size of allocated memory via Marshal.SizeOf (6 replies) |
| microsoft.public.dotnet.framework.performance |
| If I use System.Runtime.InteropServices.Marshal.SizeOf(object) , It should be the size of an unmanaged object. So far I couldn't find a method to get the memory size allocated by a managed class instance. Is there a way to do this ? for my application , I just want to keep track of memory to monitor performance issues. other than that there is no real need. But I guess, this is important. Otherwis... |
|
| Trace.axd and Event Queue (2 replies) |
| microsoft.public.dotnet.framework.performance |
| I am trying to determine where in my web application I have poor performance. A starting point is looking at the Trace.axd output for various Web requests. I am seeing that a large amount of time is being spent between EndInit BeginPreRender Also, on postbacks, a large amount of time is being spent between End ProcessPostData Begin ProcessPostData Second Try By the names of these events, it seems ... |
|
| Performance Issues under Windows 98 (4 replies) |
| microsoft.public.dotnet.framework.performance |
| I have written a number of apps that run fine in a windows 2000/XP system. These same apps require almost a minute to start up under windows 98. The window's 98 machines have equivalent ram (128 MB). The application it self is only taking about 3 MB of memory (according to the GC.GetTotalMemory(true) function call). Are there known issues with using .NET under window's 98? I have seen only one oth... |
|