digitalmars.D - Benchmarking in D
- Chris Mueller (9/9) Apr 11 2010 Hi everyone,
- Justin Spahr-Summers (5/20) Apr 11 2010 There's the benchmark() function in Phobos:
- Robert Jacques (19/28) Apr 11 2010 Here's a little benchmark routine I use:
- =?ISO-8859-15?Q?=22J=E9r=F4me_M=2E_Berger=22?= (14/26) Apr 11 2010 On what OS? On linux, you can do:
- Chris Mueller (11/34) Apr 11 2010 yep, that's what i'm missing. I give a try some of your benchmark
- =?ISO-8859-15?Q?=22J=E9r=F4me_M=2E_Berger=22?= (11/27) Apr 12 2010 I believe that the task manager can give that information. Hit
- Nathan Tuggy (8/31) Apr 13 2010 On Vista: View -> Select Columns and make sure Private Working Set is
Hi everyone, I would like to benchmark some of my D routines for performance testing and like to compare it with some alternative implementations in e.g. time and memory consumption. I'm not really experienced in this field and want to ask if someone can share his knowledge. Are there some tools providing by the operating system to look at the performance of a process? Are there any libraries in D that can help? Chris
Apr 11 2010
On Sun, 11 Apr 2010 10:27:58 +0200, Chris Mueller <ruunhb googlemail.com> wrote:Hi everyone, I would like to benchmark some of my D routines for performance testing and like to compare it with some alternative implementations in e.g. time and memory consumption. I'm not really experienced in this field and want to ask if someone can share his knowledge. Are there some tools providing by the operating system to look at the performance of a process? Are there any libraries in D that can help? ChrisThere's the benchmark() function in Phobos: http://www.digitalmars.com/d/2.0/phobos/std_date.html#benchmark Don't know if that's what you're really looking for, though.
Apr 11 2010
On Sun, 11 Apr 2010 05:27:58 -0300, Chris Mueller <ruunhb googlemail.com> wrote:Hi everyone, I would like to benchmark some of my D routines for performance testing and like to compare it with some alternative implementations in e.g. time and memory consumption. I'm not really experienced in this field and want to ask if someone can share his knowledge. Are there some tools providing by the operating system to look at the performance of a process? Are there any libraries in D that can help? ChrisHere's a little benchmark routine I use: import std.perf; import core.thread; import std.stdio; import std.algorithm; void bench(R)(string label, R delegate() dg, uint times = 1 ) { scope pc = new PerformanceCounter; real time = uint.max; foreach(i;0..times) { pc.start; dg(); pc.stop; time = min(time,pc.microseconds/1000.0); Thread.yield; } writeln(label,time,"ms"); }
Apr 11 2010
Chris Mueller wrote:Hi everyone, =20 I would like to benchmark some of my D routines for performance testing=and like to compare it with some alternative implementations in e.g. time and memory consumption. =20 I'm not really experienced in this field and want to ask if someone can=share his knowledge. =20 Are there some tools providing by the operating system to look at the performance of a process? Are there any libraries in D that can help? =20On what OS? On linux, you can do: time foo to get the run time for program foo, including elapsed clock time, time spent in the program itself and time spent in the kernel on behalf of the program (for I/O, mallocs, etc); cat /proc/$(pidof foo)/status to get memory information for a running program. I don't know any way to get the memory information once the program exits. Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Apr 11 2010
There's the benchmark() function in Phobos: http://www.digitalmars.com/d/2.0/phobos/std_date.html#benchmark Don't know if that's what you're really looking for, though....void bench(R)(string label, R delegate() dg, uint times = 1 ) { scope pc = new PerformanceCounter; real time = uint.max; foreach(i;0..times) { pc.start; dg(); pc.stop; time = min(time,pc.microseconds/1000.0); Thread.yield; } writeln(label,time,"ms"); }yep, that's what i'm missing. I give a try some of your benchmark suggestions for time measurements.On what OS? On linux, you can do: time foo to get the run time for program foo, including elapsed clock time, time spent in the program itself and time spent in the kernel on behalf of the program (for I/O, mallocs, etc); cat /proc/$(pidof foo)/status to get memory information for a running program. I don't know any way to get the memory information once the program exits.I'm currently using XP, is there any similar way to measure memory consumption? Otherwise i install a quick unix development environment on a separate partition. Thanks for your replies. Chris -- ruunhb googlemail.com http://ruuns.de/blog/
Apr 11 2010
Chris Mueller wrote:On what OS? On linux, you can do: time foo to get the run time for program foo, including elapsed clock time,=I believe that the task manager can give that information. Hit Ctl-Alt-Del, then click on the "Task Manager" button. One of the tabs gives information about the running processes. You might need to configure the displayed columns, but I don't remember how it's done and I don't have an XP box on hand to check. Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.frtime spent in the program itself and time spent in the kernel on behalf of the program (for I/O, mallocs, etc); cat /proc/$(pidof foo)/status to get memory information for a running program. I don't know any way to get the memory information once the program exits.=20 I'm currently using XP, is there any similar way to measure memory consumption? Otherwise i install a quick unix development environment on a separate partition. =20
Apr 12 2010
On 2010-04-12 11:09, "Jérôme M. Berger" wrote:Chris Mueller wrote:On Vista: View -> Select Columns and make sure Private Working Set is checked. On XP, checking Memory Usage will get you most of the way there, although it's not quite as good (it lumps in any working set shared with other processes too). -- ~ My software never has bugs. It just develops random features. ~ http://tagzilla.mozdev.org v0.066I believe that the task manager can give that information. Hit Ctl-Alt-Del, then click on the "Task Manager" button. One of the tabs gives information about the running processes. You might need to configure the displayed columns, but I don't remember how it's done and I don't have an XP box on hand to check. JeromeOn what OS? On linux, you can do: time foo to get the run time for program foo, including elapsed clock time, time spent in the program itself and time spent in the kernel on behalf of the program (for I/O, mallocs, etc); cat /proc/$(pidof foo)/status to get memory information for a running program. I don't know any way to get the memory information once the program exits.I'm currently using XP, is there any similar way to measure memory consumption? Otherwise i install a quick unix development environment on a separate partition.
Apr 13 2010