digitalmars.D - path tracing benchmark
- Trass3r (23/23) Aug 07 2011 I ported smallpt to D some time ago and now that I've working versions o...
- bearophile (10/12) Aug 07 2011 I have converted to D many of the commonly found benchmarks, this is my ...
- %u (3/3) Aug 08 2011 This is off topic but if you're interested you can get it to run using
- Christian Kamm (5/23) Aug 09 2011 bearophile, just out of interest, what's the performance like if you ran...
- bearophile (5/8) Aug 09 2011 It's the only way I have found to perform link-time-optimization with LD...
- Jacob Carlborg (5/9) Aug 09 2011 ldmd is a wrapper that converts dmd arguments to ldc arguments. So you
- Trass3r (1/6) Aug 10 2011 Is there a more convenient way to get LTO with LDC?
- bearophile (4/5) Aug 10 2011 This is the best/only one I have found for LDC1. Feel free to search for...
- Trass3r (4/8) Aug 10 2011 Well, obviously you need to install the gold linker and that llvm plugin...
- Trass3r (2/3) Aug 10 2011 Had a quick look at the source, no indications that -O4 and O5 do anythi...
- Robert Clipsham (7/10) Aug 10 2011 They don't, there's no way to do LTO built into LDC. I seem to recall
- Trass3r (4/10) Aug 10 2011 Why is there no way?
- Robert Clipsham (7/18) Aug 10 2011 Of course it can - I said "built into", not "in". The only reason it's
I ported smallpt to D some time ago and now that I've working versions of LDC2 and GDC2 I did a quick comparison: Original code: http://kevinbeason.com/smallpt/explicit.cpp D version: https://bitbucket.org/trass3r/smallptd/src C++ -- g++ -O3 explicit.cpp: Rendering (4 spp) 100.00% real 0m28.477s user 0m26.470s sys 0m0.160s D -- dmd -release -O -inline -noboundscheck smallpt.d -ofsmallptDMD: real 1m32.687s user 1m30.820s sys 0m0.300s D -- gdc -frelease -fno-bounds-check -O3 smallpt.d -o smallptGDC: real 0m52.598s user 0m48.900s sys 0m0.150s D -- ldc2 -O3 -release -enable-inlining smallpt.d -ofsmallptLDC: real 0m39.622s user 0m36.100s sys 0m0.240s
Aug 07 2011
Trass3r:I ported smallpt to D some time ago and now that I've working versions of LDC2 and GDC2 I did a quick comparison:I have converted to D many of the commonly found benchmarks, this is my version: http://codepad.org/ZbmSfseY If I compile it with with LDC1 with Link Time Optimization + Interning: ldc -O3 -release -inline -output-bc smallpt2_d.d opt -std-compile-opts smallpt2_d.bc > smallpt2_do.bc llvm-ld -native -ltango-base-ldc -ltango-user-ldc -ldl -lm -lpthread -internalize-public-api-list=_Dmain -o=smallpt2_do smallpt2_do.bc I produce a binary that's faster than the C++ version (22.7 seconds instead of 29 seconds). Bye, bearophile
Aug 07 2011
This is off topic but if you're interested you can get it to run using float if you change the Sphere code to: FP eps = 1e-2; instead of 1e-4;
Aug 08 2011
bearophile wrote:Trass3r:bearophile, just out of interest, what's the performance like if you ran ldmd -O3 -release -inline smallpt2_d.d ? If everything worked right -std- compile-opts should do the same that LDC does at -O3. And why would internalizing _Dmain have a noticable performance impact?I ported smallpt to D some time ago and now that I've working versions of LDC2 and GDC2 I did a quick comparison:I have converted to D many of the commonly found benchmarks, this is my version: http://codepad.org/ZbmSfseY If I compile it with with LDC1 with Link Time Optimization + Interning: ldc -O3 -release -inline -output-bc smallpt2_d.d opt -std-compile-opts smallpt2_d.bc > smallpt2_do.bc llvm-ld -native -ltango-base-ldc -ltango-user-ldc -ldl -lm -lpthread -internalize-public-api-list=_Dmain -o=smallpt2_do smallpt2_do.bc I produce a binary that's faster than the C++ version (22.7 seconds instead of 29 seconds).
Aug 09 2011
Christian Kamm:bearophile, just out of interest, what's the performance like if you ran ldmd -O3 -release -inline smallpt2_d.d ?I don't remember what ldmd is. Without LTO the performance of the LDC compile was a bit lower than the G++ compile.And why would internalizing _Dmain have a noticable performance impact?It's the only way I have found to perform link-time-optimization with LDC1. It assumes the whole program is compiled at once, so it's able to perform more cross optimizations. Bye, bearophile
Aug 09 2011
On 2011-08-09 22:04, bearophile wrote:Christian Kamm:ldmd is a wrapper that converts dmd arguments to ldc arguments. So you can call ldc with the same arguments you would call dmd. -- /Jacob Carlborgbearophile, just out of interest, what's the performance like if you ran ldmd -O3 -release -inline smallpt2_d.d ?I don't remember what ldmd is. Without LTO the performance of the LDC compile was a bit lower than the G++ compile.
Aug 09 2011
If I compile it with with LDC1 with Link Time Optimization + Interning: ldc -O3 -release -inline -output-bc smallpt2_d.d opt -std-compile-opts smallpt2_d.bc > smallpt2_do.bc llvm-ld -native -ltango-base-ldc -ltango-user-ldc -ldl -lm -lpthread -internalize-public-api-list=_Dmain -o=smallpt2_do smallpt2_do.bcIs there a more convenient way to get LTO with LDC?
Aug 10 2011
Trass3r:Is there a more convenient way to get LTO with LDC?This is the best/only one I have found for LDC1. Feel free to search for something better/shorter (and tell me if you find it, please). Bye, bearophile
Aug 10 2011
Am 10.08.2011, 14:54 Uhr, schrieb bearophile <bearophileHUGS lycos.com>:Trass3r:Well, obviously you need to install the gold linker and that llvm plugin. But I don't know how to go on after that. LDC does have -O4 and -O5 switches but they probably don't work?!Is there a more convenient way to get LTO with LDC?This is the best/only one I have found for LDC1. Feel free to search for something better/shorter (and tell me if you find it, please).
Aug 10 2011
LDC does have -O4 and -O5 switches but they probably don't work?!Had a quick look at the source, no indications that -O4 and O5 do anything more than -O3.
Aug 10 2011
On 10/08/2011 14:49, Trass3r wrote:They don't, there's no way to do LTO built into LDC. I seem to recall some conversation about adding it, I may just be remembering this thread though *g* -- Robert http://octarineparrot.com/LDC does have -O4 and -O5 switches but they probably don't work?!Had a quick look at the source, no indications that -O4 and O5 do anything more than -O3.
Aug 10 2011
Am 10.08.2011, 18:16 Uhr, schrieb Robert Clipsham <robert octarineparrot.com>:On 10/08/2011 14:49, Trass3r wrote:Why is there no way? Can't LDC be modified to support gold+plugin just like clang?Had a quick look at the source, no indications that -O4 and O5 do anything more than -O3.They don't, there's no way to do LTO built into LDC. I seem to recall some conversation about adding it, I may just be remembering this thread though *g*
Aug 10 2011
On 10/08/2011 17:43, Trass3r wrote:Am 10.08.2011, 18:16 Uhr, schrieb Robert Clipsham <robert octarineparrot.com>:Patches welcome ;)On 10/08/2011 14:49, Trass3r wrote:Why is there no way?Had a quick look at the source, no indications that -O4 and O5 do anything more than -O3.They don't, there's no way to do LTO built into LDC. I seem to recall some conversation about adding it, I may just be remembering this thread though *g*Can't LDC be modified to support gold+plugin just like clang?Of course it can - I said "built into", not "in". The only reason it's not there is because no one has written support for it. -- Robert http://octarineparrot.com/
Aug 10 2011