Click here to Skip to main content
15,899,754 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: how to hide properties in propertyGrid Pin
Pete O'Hanlon3-Aug-09 22:06
mvePete O'Hanlon3-Aug-09 22:06 
GeneralRe: how to hide properties in propertyGrid Pin
DaveyM694-Aug-09 1:43
professionalDaveyM694-Aug-09 1:43 
AnswerRe: how to hide properties in propertyGrid Pin
Patrick Fox28-Jul-09 10:06
Patrick Fox28-Jul-09 10:06 
QuestionCreate an embeded aplication Pin
rick055626-Jul-09 21:24
rick055626-Jul-09 21:24 
AnswerRe: Create an embeded aplication Pin
King Julien27-Jul-09 3:47
King Julien27-Jul-09 3:47 
QuestionHow to convert structure from rows to columns !!!??? very strange ! Pin
Feras Mazen Taleb26-Jul-09 21:06
Feras Mazen Taleb26-Jul-09 21:06 
Questiontooltip control for win ce app Pin
obalesu26-Jul-09 20:43
obalesu26-Jul-09 20:43 
QuestionSlow Multicast Delegates ? Pin
sneusse26-Jul-09 9:00
sneusse26-Jul-09 9:00 
Hi,
I did some tests and realized that multicast delegates are slower than a generic list of delegates.
Did i make a mistake or is this correct?

This is the code i used.
class MyObject {
    const int childMax = 10;
    const int runMax = 100000000;

    Stopwatch SW = new Stopwatch();

    event EventHandler MyEvent;
    List<EventHandler> eventList = new List<EventHandler>();
    Dictionary<string, EventHandler> eventDict = new Dictionary<string, EventHandler>();

    int iterator = 0;

    public MyObject() {
        for (int i = 0; i< childMax ; i++ ) {
            eventList.Add(MyFunc);
            eventDict.Add(i.ToString(),MyFunc);
            MyEvent += MyFunc;

        }
    }

    public void Test() {
        // Normal Multicast Events
        SW.Start();
        for (int i = 0; i< runMax ; i++ ) {
            MyEvent(null,null);
        }
        SW.Stop();
        Console.WriteLine("Iterator=" + iterator.ToString("n") + " using Events, Elapsed: " + SW.Elapsed.ToString());
        SW.Reset();

        // Generic List
        SW.Start();
        for (int i = 0; i< runMax ; i++ ) {
            for (int j = 0; j < childMax; j++) {
                eventList[j](null,null);
            }
        }
        SW.Stop();
        Console.WriteLine("Iterator=" + iterator.ToString("n") + " using List, Elapsed: " + SW.Elapsed.ToString());
        SW.Reset();
    }

    private void MyFunc(object sender, EventArgs e) {
        //Dummy;
        iterator++;
    }
}


This is the result on my machine (2,2 gHz)
Iterator=1.000.000.000,00 using Events, Elapsed: 00:00:06.2153030
Iterator=2.000.000.000,00 using List, Elapsed: 00:00:04.8695574
Press any key to continue . . .

AnswerRe: Slow Multicast Delegates ? Pin
PIEBALDconsult26-Jul-09 15:00
mvePIEBALDconsult26-Jul-09 15:00 
AnswerRe: Slow Multicast Delegates ? Pin
Luc Pattyn26-Jul-09 19:25
sitebuilderLuc Pattyn26-Jul-09 19:25 
AnswerRe: Slow Multicast Delegates ? Pin
DaveyM6927-Jul-09 1:45
professionalDaveyM6927-Jul-09 1:45 
GeneralRe: Slow Multicast Delegates ? Pin
Luc Pattyn27-Jul-09 11:23
sitebuilderLuc Pattyn27-Jul-09 11:23 
GeneralRe: Slow Multicast Delegates ? Pin
DaveyM6927-Jul-09 13:20
professionalDaveyM6927-Jul-09 13:20 
QuestionObject reference not set to an instance of an object. Pin
ChiSmile26-Jul-09 8:28
ChiSmile26-Jul-09 8:28 
AnswerRe: Object reference not set to an instance of an object. Pin
Adam Maras26-Jul-09 8:53
Adam Maras26-Jul-09 8:53 
AnswerRe: Object reference not set to an instance of an object. Pin
Pete O'Hanlon26-Jul-09 9:09
mvePete O'Hanlon26-Jul-09 9:09 
GeneralRe: Object reference not set to an instance of an object. Pin
ChiSmile26-Jul-09 9:16
ChiSmile26-Jul-09 9:16 
GeneralRe: Object reference not set to an instance of an object. Pin
Pete O'Hanlon26-Jul-09 10:13
mvePete O'Hanlon26-Jul-09 10:13 
QuestionAutoGenerateColumns being overwritten by Visual Studio IDE Pin
Kevin Geary25-Jul-09 9:54
Kevin Geary25-Jul-09 9:54 
AnswerRe: AutoGenerateColumns being overwritten by Visual Studio IDE Pin
Henry Minute26-Jul-09 9:51
Henry Minute26-Jul-09 9:51 
QuestionWhy does Crystal take so long to set datasource only the first time Pin
Hypermommy25-Jul-09 2:30
Hypermommy25-Jul-09 2:30 
QuestionActiveElement Pin
majidmadadi24-Jul-09 19:14
majidmadadi24-Jul-09 19:14 
QuestionActiveDirectory Question [SOLVED] Pin
#realJSOP24-Jul-09 2:48
professional#realJSOP24-Jul-09 2:48 
Questiondetailsview edit Pin
rim jhim23-Jul-09 20:44
rim jhim23-Jul-09 20:44 
AnswerRe: detailsview edit Pin
Suvabrata Roy19-Mar-13 23:54
professionalSuvabrata Roy19-Mar-13 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.