.NET news » Search results
Search results for query "line count" (10):
Performance Quiz #9 : IList<T> List and array speed
A short and sweet quiz with lots of juicy discussion possibilities:
public int Sum(IList<ushort> indices)
{
int result = 0;
for (int i = 0; i < indices.Count; i++)
result += indices[i];
return result;
}
Considering only the time it takes to do the Sum (i.e. assuming we had already set up the array/list) which gives better performance and why?
// #1
ushort[] tmp = new ushort[500000]; // this doesn't count
Sum(tmp);// this is what we are timing
OR
// #2
List<ushort> tmp = new List<ushort>(500000); // this doesn't count
for (int i = 0; i < 500000; i++)tmp.Add(0); // this doesn't count
Sum(tmp); // this is what we are timing
What say you gentle readers?
2006-03-09 18:31:00 Source: Performance Quiz #9 : IList<T> List and array speed
Tags: Performance
C#
System.Diagnostics.Stopwatch - always remember to use Reset
Wrong
System.Diagnostics.Stopwatch s = new System.Diagnostics.Stopwatch();
s.Start();
for (i = 0; i count; i++) Test1();
s.Stop();
Console.WriteLine("Test1: {0}", s.ElapsedMilliseconds);
s.Start();
for (i = 0; i count; i++) Test2();
s.Stop();
Console.WriteLine("Test2: {0}", s.ElapsedMilliseconds);
Right
System.Diagnostics.Stopwatch s = new System.Diagnostics.Stopwatch();
s.Start();
for (i = 0; i count; i++) Test1();
s.Stop();
Console.WriteLine("Test1: {0}", s.ElapsedMilliseconds);
s.Reset();
s.Start();
for (i = 0; i count; i++) Test2();
s.Stop();
Console.WriteLine("Test2: {0}", s.ElapsedMilliseconds);
Not that *cough* I would ever make this mistake or anything, but you know... it could happen to like, a friend, or something. Ya. My friend. :)
2006-07-18 14:18:00 Source: System.Diagnostics.Stopwatch - always remember to use Reset
Tags: Performance
Line Counter - Writing a Visual Studio 2005 Add-In
Provides complete Solution and Project line counting and summary tool, written as a Visual Studio 2005 Managed Add-In (C#).
2006-04-29 03:06:00 Source: Line Counter - Writing a Visual Studio 2005 Add-In
Tags: Addins
Visual Studio
Create Dynamic XAML Forms with the Presentation Model Pattern
This article presents an advanced technique that lets you bind multiple editable line items to a collection using Windows Presentation Foundation and the Presentation Model pattern. It assumes you are familiar with basic WPF data binding techniques as well as design patterns that object-oriented UI libraries typically use. After an introduction to the sample application used throughout this article, you'll see how applying the Presentation Model pattern insulates this application's UI and business logic layers from one another. Finally, you'll see the WPF-specific details involved in binding a Presentation Model to XAML controls to create a dynamic UI with multiple editable line items.
Access image metadata using Visual Studio's new object data binding feature
Using a new class library to bind to photo metadata with a few line of code.
2007-02-01 21:45:00 Source: Access image metadata using Visual Studio's new object...
Tags: Multimedia
SharePoint Applied - Stsadm Is Your Friend
I am a self confessed command line junkie. Sure I see value in GUIs, and GUIs are great to get accustomed to a tool, but once I start crawling, I like to walk, run, and then fly. And when I fly, a GUI's sluggishness in getting tasks done becomes seriously annoying.
A flexible charting library for .NET
Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
User Interface generator for ASP.NET database applications
In web applications, many pages have simple CRUD purposes. This presentation shows how to produce these pages without a single line of code by generating them with description files.
2006-09-17 17:07:00 Source: User Interface generator for ASP.NET database applications
Tags: Database
ASP.NET
RegexToXml regular expression to XML converter
RegexToXml is a command line utility which applies a regular expression to input text and returns the results as an XML document.
Line Counter - Writing a SharpDevelop AddIn
This article shows you how to start writing SharpDevelop AddIns by porting Jon Rista's VS AddIn to SharpDevelop
1


Syndicate