How can we help you today? How can we help you today?
leerjet
I think I have come across the potential source of this problem, which looks like a serious deficiency in ANTS. I will write it up here as it might be useful to your engineers. Look at the two segements of code below: public void test() { Console.WriteLine("Before try/catch loop: " + DateTime.Now.ToLongTimeString()); for(int j = 0;j < 1000;++j) { try { int k = Int32.Parse("123"); } catch { } } Console.WriteLine("After try/catch loop: " + DateTime.Now.ToLongTimeString()); } public void test() { Console.WriteLine("Before try/catch loop: " + DateTime.Now.ToLongTimeString()); for(int j = 0;j < 1000;++j) { try { int k = Int32.Parse("abc"); } catch { } } Console.WriteLine("After try/catch loop: " + DateTime.Now.ToLongTimeString()); } When run under the normal debugger, the first code segment shows that the times before and after loop are the same, essentially meaning that it took less than a second. (Int32.Parse coverts the number string to an integer). Then second code segment, which will generate an exception that is "caught" (because "abc" is not a number), shows the time before and after difference as about 5 seconds. When run under ANTS, both segments report about 0.7 seconds. It seems that the time wasted by .Net for the exception is not taken into account. If this can be duplicated by you, I would consider it serious problem as code like this could potentially be the source of a slowdown in an application under test if a block like that happens to execute too many times. / comments
I think I have come across the potential source of this problem, which looks like a serious deficiency in ANTS. I will write it up here as it might be useful to your engineers. Look at the two sege...
0 votes
Brian: Please take the time to understand the information I am giving you before responding. Let me try and organize the facts for you: 1. When I run at full speed with no breakpoints, the Console.WriteLine statements before and after the "...AddRange" statement clearly indicate a before/after time difference of 5 seconds. 2. Now, to prove that the AddRange statement actually takes about five seconds, I place a breakpoint at the AddRange line. I then run the program under debug allowing it to break at the AddRange statement. Pressing the "Step Over" debug toolbar button once will force another breakpoint at the statement directly after the current line within the same method. Therefore, pressing that button will cause another breakpoint at the 2nd Console.WriteLine. When I press the StepOver toolbar icon I use my watch to time how long it takes. The result is still approximately 5 seconds. That proves without question that the AddRange statement is slow.The time it takes the debugger to start and stop is largely insignificant. compared to the 5 seconds observed. 3. Now I run my project under ANTS Profiler 3. I press the applications button that causes the above event handler to be invoked and immediately after the results of the AddRange are displayed (it fills a list view) I force ANTS to take a snapshot. I then press the "All methods" tab to see detailed information. No matter whether I look at the "time with children" data for the "btnAdd100Rows_Click" statement or the actual "AddRange" routine being called in the "Source code" section at the button of the ANTS window and look at line timings for the button event handler, it shows that the AddRange line took 0.771 seconds. All cases show exactly 1 Hit count. The question then remains, what would cause ANTS to report one eighth of the time it actually takes for that single statement? / comments
Brian: Please take the time to understand the information I am giving you before responding. Let me try and organize the facts for you: 1. When I run at full speed with no breakpoints, the Console....
0 votes