[Issue 9581] Regression (2.053): Exception takes too much time to show up

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 23 19:47:38 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9581



--- Comment #5 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-02-23 19:47:32 PST ---
(In reply to comment #4)
> If what you're testing is the amount of time that it takes an exception to be
> thrown and caught, then you shouldn't be doing anything like call system, since
> then that's testing what system's up to. And even worse, you're starting a
> different program, meaning that you're testing the amount of time it takes to
> run the program (including the startup time for druntime). Please test only one
> thing at a time.
> 
> If system's too slow, then create a test just for that and a bug report for it.
> If exceptions are too slow, then cerate a test just for that and bug report for
> it. If druntime takes too long to startup, then create a test just for that and
> create a bug report for it. You're testing too many things at once here.

This is the test-case:

--------
module test;

void main()
{
    assert(0);
}
---------

You can use `timeit` or some other timing app you may have installed on the
system, the 'timer' was just there in case someone doesn't have an alternative
to test it with. 

Anyway you can get 'timeit' from
http://www.microsoft.com/en-us/download/details.aspx?id=17657, then the test
runs are:

2.052:
$ D:\foobar>dmd test.d
$ D:\foobar>timeit test
core.exception.AssertError at test(5): Assertion failure

Version Number:   Windows NT 5.1 (Build 2600)
Exit Time:        4:45 am, Sunday, February 24 2013
Elapsed Time:     0:00:00.078
Process Time:     0:00:00.031
System Calls:     2121
Context Switches: 456
Page Faults:      678
Bytes Read:       142408
Bytes Written:    0
Bytes Other:      124382

2.053:
D:\foobar>dmd test.d
D:\foobar>timeit test
core.exception.AssertError at test(5): Assertion failure
----------------
40CE70
40CCE7
40201A
4025C7
4021C3
4120C9
7C817067
----------------

Version Number:   Windows NT 5.1 (Build 2600)
Exit Time:        4:46 am, Sunday, February 24 2013
Elapsed Time:     0:00:04.093
Process Time:     0:00:01.265
System Calls:     72733
Context Switches: 38975
Page Faults:      18821
Bytes Read:       17758445
Bytes Written:    8283
Bytes Other:      55317

The system calls should give a hint here, it's an enormous increase from 2121
calls in 2.052 to 72733 calls in 2.053.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list