digitalmars.D.learn - Can we turn off array's bounds-check?
- uframer (4/4) May 24 2005 I find it's disturbing when i'm using D in the program for my thesis. In...
- clayasaurus (2/8) May 24 2005 Have you tried passing the -release and -O options to the dmd compiler?
- uframer (4/11) May 25 2005 Yes, i have tried that, but the effect is unclear. The D program's time
- Unknown W. Brackets (4/6) May 25 2005 How are you doing it?
- Ben Hinkle (5/7) May 25 2005 Compile with -profile and look at trace.log to see where the time goes.
- David Medlock (6/12) May 25 2005 Use a pointer.
- uframer (3/8) May 25 2005 Thank you all!
I find it's disturbing when i'm using D in the program for my thesis. In an ant-based algorithm the basic operation is array access, it will be called even over 10e8 times! So you guys know why i want to turn the check off. Any ideas?
May 24 2005
uframer wrote:I find it's disturbing when i'm using D in the program for my thesis. In an ant-based algorithm the basic operation is array access, it will be called even over 10e8 times! So you guys know why i want to turn the check off. Any ideas?Have you tried passing the -release and -O options to the dmd compiler?
May 24 2005
Yes, i have tried that, but the effect is unclear. The D program's time consumption is about 10 times of the cpp one's. Sigh! "clayasaurus" <clayasaurus gmail.com> ??????:d70som$675$1 digitaldaemon.com...uframer wrote:I find it's disturbing when i'm using D in the program for my thesis. In an ant-based algorithm the basic operation is array access, it will be called even over 10e8 times! So you guys know why i want to turn the check off. Any ideas?Have you tried passing the -release and -O options to the dmd compiler?
May 25 2005
How are you doing it? Using -release should turn off array boundary checking. Have you tried -inline as well? -[Unknown]Yes, i have tried that, but the effect is unclear. The D program's time consumption is about 10 times of the cpp one's. Sigh!
May 25 2005
"uframer" <uframer sina100.com.cn> wrote in message news:d71btq$1s3u$1 digitaldaemon.com...Yes, i have tried that, but the effect is unclear. The D program's time consumption is about 10 times of the cpp one's. Sigh!Compile with -profile and look at trace.log to see where the time goes. You'll probably want to run profiled builds on smaller problems than a release build since tracing adds lots of overhead to the app.
May 25 2005
uframer wrote:I find it's disturbing when i'm using D in the program for my thesis. In an ant-based algorithm the basic operation is array access, it will be called even over 10e8 times! So you guys know why i want to turn the check off. Any ideas?Use a pointer. for most arrays there is a property .ptr char[100] mychars; char* p = mychars.ptr; The pointer does not have a bounds check i believe.
May 25 2005
Thank you all! I think i have fixed the problem. "uframer" <uframer sina100.com.cn> 写入消息新闻:d70qtf$1gv$1 digitaldaemon.com...I find it's disturbing when i'm using D in the program for my thesis. In an ant-based algorithm the basic operation is array access, it will be called even over 10e8 times! So you guys know why i want to turn the check off. Any ideas?
May 25 2005
In article <d720ps$2pcd$1 digitaldaemon.com>, uframer says...Thank you all! I think i have fixed the problem. "uframer" <uframer sina100.com.cn> 写入消息新闻:d70qtf$1gv$1 digitaldaemon.com...Please, share your solution. We'd all like to learn how to better overcome such problems in our own code. :) - EricAnderton at yahooI find it's disturbing when i'm using D in the program for my thesis. In an ant-based algorithm the basic operation is array access, it will be called even over 10e8 times! So you guys know why i want to turn the check off. Any ideas?
May 25 2005
In article <d725kb$2tuf$1 digitaldaemon.com>, pragma says...In article <d720ps$2pcd$1 digitaldaemon.com>, uframer says...Yes - and also please post the two sets of source code along with the different performance measurements you got. This would be interesting to many of us as well. - DaveThank you all! I think i have fixed the problem. "uframer" <uframer sina100.com.cn> 写入消息新闻:d70qtf$1gv$1 digitaldaemon.com...Please, share your solution. We'd all like to learn how to better overcome such problems in our own code. :) - EricAnderton at yahooI find it's disturbing when i'm using D in the program for my thesis. In an ant-based algorithm the basic operation is array access, it will be called even over 10e8 times! So you guys know why i want to turn the check off. Any ideas?
May 25 2005
Oops, i'm really a bad coder! I think i should apologize for the blame on D. The performance problem does not mainly come from difference between D and Cpp, but from a subtle structure difference between the two versions that would alter the ants' random behavior significantly.:( And , -release helps, it reduces the time consumption by about 30%.
May 27 2005