digitalmars.D.announce - Chimpfella - new library to do benchmarking with ranges (even with
- Max Haughton (32/32) Dec 18 2020 https://code.dlang.org/packages/chimpfella
- =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= (6/9) Dec 19 2020 ...
- =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= (6/18) Dec 19 2020 and I want some like this for memory:
- Max Haughton (3/23) Dec 19 2020 Memory is a bit harder but I will add it.
- welkam (3/6) Dec 20 2020 Are you going to read stdout from calling perf or are you going
- Max Haughton (11/18) Dec 20 2020 I already have code that uses perf_event_open directly, it's much
https://code.dlang.org/packages/chimpfella Haven't finished documenting it yet. This uses enormous amounts of static this and that and templates, so expect vague error messages (I have tried to catch obvious errors early using static asserts but they aren't magic). This will soon support Linux's perf_event so you will be able to measure cache misses (and all the other thousands of pmc's intel expose), use LBR msrs etc. Quick code sample: If for some reason you wanted to measure how many CPUID's it takes to make your cpu literally useless, you'd write this code (the ctfeRepeater helper function is because dmd doesn't like map at compile time) static string ctfeRepeater(int n) { return "cpuid;".repeat(n).join(); } enum cpuidRange = iota(1, 10).map!(ctfeRepeater).array; TemplateBenchmark!(0, cpuidRange) FunctionBenchmark!("Measure", iota(1, 10), (_) => [1, 2, 3, 4])(meas) static int sum(string asmLine)(inout int[] input) { //This is quite fun because ldc will sometimes get rid of the entire function body and just loop over the asm's int tmp; foreach (i; input) { mixin("asm { ", asmLine, ";}"); } return tmp; }
Dec 18 2020
On Saturday, 19 December 2020 at 05:08:56 UTC, Max Haughton wrote:https://code.dlang.org/packages/chimpfella Haven't finished documenting it yet. [...]... wrapper function() ... I like it!
Dec 19 2020
On Saturday, 19 December 2020 at 08:30:09 UTC, Виталий Фадеев wrote:On Saturday, 19 December 2020 at 05:08:56 UTC, Max Haughton wrote:and I want some like this for memory: save process memory call func() print memory deltahttps://code.dlang.org/packages/chimpfella Haven't finished documenting it yet. [...]... wrapper function() ... I like it!
Dec 19 2020
On Saturday, 19 December 2020 at 09:39:49 UTC, Виталий Фадеев wrote:On Saturday, 19 December 2020 at 08:30:09 UTC, Виталий Фадеев wrote:Memory is a bit harder but I will add it.On Saturday, 19 December 2020 at 05:08:56 UTC, Max Haughton wrote:and I want some like this for memory: save process memory call func() print memory deltahttps://code.dlang.org/packages/chimpfella Haven't finished documenting it yet. [...]... wrapper function() ... I like it!
Dec 19 2020
On Saturday, 19 December 2020 at 05:08:56 UTC, Max Haughton wrote:This will soon support Linux's perf_event so you will be able to measure cache misses (and all the other thousands of pmc's intel expose), use LBR msrs etc.Are you going to read stdout from calling perf or are you going to read perf.data file?
Dec 20 2020
On Monday, 21 December 2020 at 03:27:14 UTC, welkam wrote:On Saturday, 19 December 2020 at 05:08:56 UTC, Max Haughton wrote:I already have code that uses perf_event_open directly, it's much more efficient at the expense of having to decipher shit linux documentation. I tried to get the bindings into druntime but they weren't up to snuff apparently. The architecture of the counters is designed around a stateless widget giving you a stateful gadget specifically because this makes using perf_event_open less of a minefield. You can also enable userspace-rdpmc, which I will support eventually (but you get a general protection fault if something goes wrong so it's hard to debug).This will soon support Linux's perf_event so you will be able to measure cache misses (and all the other thousands of pmc's intel expose), use LBR msrs etc.Are you going to read stdout from calling perf or are you going to read perf.data file?
Dec 20 2020