Re: Profiling using Visual Studio

2023-10-22 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 22 October 2023 at 13:16:11 UTC, Imperatorn wrote: On Sunday, 22 October 2023 at 13:13:55 UTC, Imperatorn wrote: I would just like to share some knowledge about profiling an exe using Visual Studio, since many might already have that installed. [...] On Sunday, 22 October 2023

Re: Profiling using Visual Studio

2023-10-22 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 22 October 2023 at 13:13:55 UTC, Imperatorn wrote: I would just like to share some knowledge about profiling an exe using Visual Studio, since many might already have that installed. [...] On Sunday, 22 October 2023 at 13:13:55 UTC, Imperatorn wrote: Just a clarification. "open

Re: Profiling

2021-08-25 Thread René Zwanenburg via Digitalmars-d-learn
On Tuesday, 24 August 2021 at 10:33:07 UTC, JG wrote: The reason for the crash boils down to the fact that this fails: foreach(k; sort!"a > b"(funcs.keys)) assert(k in funcs); funcs is of type ubyte[4][float] Is this a compiler bug? That assert will fail if there are NaN keys in the AA.

Re: Profiling

2021-08-24 Thread JG via Digitalmars-d-learn
On Tuesday, 24 August 2021 at 09:45:31 UTC, JG wrote: On Tuesday, 24 August 2021 at 09:42:29 UTC, JG wrote: On Tuesday, 24 August 2021 at 09:36:06 UTC, JG wrote: [...] In case anyone is interested it seems that it was forked to here: https://github.com/joakim-brannstrom/profdump Perhaps

Re: Profiling

2021-08-24 Thread JG via Digitalmars-d-learn
On Tuesday, 24 August 2021 at 09:42:29 UTC, JG wrote: On Tuesday, 24 August 2021 at 09:36:06 UTC, JG wrote: On Wednesday, 10 February 2021 at 23:42:31 UTC, mw wrote: [...] I tried to do this, but I am not sure how to install profdump. What I did is cloned the repository using git. Tried to

Re: Profiling

2021-08-24 Thread JG via Digitalmars-d-learn
On Tuesday, 24 August 2021 at 09:36:06 UTC, JG wrote: On Wednesday, 10 February 2021 at 23:42:31 UTC, mw wrote: [...] I tried to do this, but I am not sure how to install profdump. What I did is cloned the repository using git. Tried to build it using dub but got an error as described here:

Re: Profiling

2021-08-24 Thread JG via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 23:42:31 UTC, mw wrote: On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: As a follow up question I would like to know what tool people use to profile d programs? I use this one: https://code.dlang.org/packages/profdump e.g. ``` dub build

Re: Profiling

2021-02-12 Thread James Blachly via Digitalmars-d-learn
On 2/9/21 12:45 AM, JG wrote: I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-profile-viewer and got the following error:

Re: Profiling

2021-02-11 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 23:42:31 UTC, mw wrote: On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: As a follow up question I would like to know what tool people use to profile d programs? I use this one: https://code.dlang.org/packages/profdump e.g. ``` dub build

Re: Profiling

2021-02-10 Thread mw via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: As a follow up question I would like to know what tool people use to profile d programs? I use this one: https://code.dlang.org/packages/profdump e.g. ``` dub build --build=debug --build=profile # run your program to generate

Re: Profiling

2021-02-10 Thread Max Haughton via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 13:31:09 UTC, Guillaume Piolat wrote: On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: [...] Here is what I use for sampling profiler: (On Windows) Build with LDC, x86_64, with dub -b release-debug in order to have debug info. Run your program

Re: Profiling

2021-02-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: Thanks for the suggestions. However, I would prefer not to spend time trying to debug d-profile-viewer at the moment. As a follow up question I would like to know what tool people use to profile d programs? Here is what I use for

Re: Profiling

2021-02-10 Thread drug via Digitalmars-d-learn
On 2/10/21 2:52 PM, JG wrote: On Tuesday, 9 February 2021 at 18:33:16 UTC, drug wrote: On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote: I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran

Re: Profiling

2021-02-10 Thread JG via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 18:33:16 UTC, drug wrote: On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote: I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-profile-viewer and got the

Re: Profiling

2021-02-09 Thread drug via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote: I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-profile-viewer and got the following error:

Re: Profiling

2021-02-09 Thread Dukc via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 16:39:25 UTC, Dukc wrote: You may have or may not have done it wrong, but in any case this is a bug. If you do something wrong, the program should tell you what you did wrong, instead of telling you that character '-' does not belong to middle of a long int. Oh

Re: Profiling

2021-02-09 Thread Dukc via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote: Is d-profile-viewer no longer working? Or did I do something wrong? You may have or may not have done it wrong, but in any case this is a bug. If you do something wrong, the program should tell you what you did wrong, instead of telling

Re: Profiling the memory in D

2019-12-07 Thread kerdemdemir via Digitalmars-d-learn
On Wednesday, 4 December 2019 at 22:51:45 UTC, Steven Schveighoffer wrote: I localized that the leak was actually being caused by websockets. I want to write down my experience because I did some weird stuff which seems to be working but I want to learn how it actually make sense and works.

Re: Profiling the memory in D

2019-12-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/4/19 5:04 PM, kerdemdemir wrote: GC.sizeof(cast(void*)object) will be super useful. I will use that. I also tried GC: --DRT-gcopt=profile:1 already. It provides so little information. I need to find out which member AA or array of which object is causing this memory problem of mine.I

Re: Profiling the memory in D

2019-12-04 Thread kerdemdemir via Digitalmars-d-learn
On Wednesday, 4 December 2019 at 15:38:36 UTC, Steven Schveighoffer wrote: On 12/4/19 3:10 AM, Erdem wrote: I am used to have cool tools like valgrid massif to visualize the memory usage from C++ but in D it seems I am blind folded looking for the problem. Until now I tried: --vgc option

Re: Profiling the memory in D

2019-12-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/4/19 3:10 AM, Erdem wrote: I am used to have cool tools like valgrid massif to visualize the memory usage from C++ but in D it seems I am blind folded looking for the problem. Until now I tried: --vgc option which show million things which makes it not useful --build=profile-gc which

Re: Profiling with DUB?

2018-11-06 Thread Dukc via Digitalmars-d-learn
On Monday, 29 October 2018 at 10:14:23 UTC, Dukc wrote: When I run the program, where is the performance profile file supposed to appear? I can find nothing new in the program/project root directory. The same thing happens when I try to get a coverage report: No file appears.

Re: Profiling with DUB?

2018-11-05 Thread Dukc via Digitalmars-d-learn
On Thursday, 1 November 2018 at 13:59:39 UTC, Guillaume Piolat wrote: On Monday, 29 October 2018 at 10:14:23 UTC, Dukc wrote: I'm trying to profile my program, built like: dub build --build=profile When I run the program, where is the performance profile file supposed to appear? I can find

Re: Profiling with DUB?

2018-11-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 29 October 2018 at 10:14:23 UTC, Dukc wrote: I'm trying to profile my program, built like: dub build --build=profile When I run the program, where is the performance profile file supposed to appear? I can find nothing new in the program/project root directory. This happens

Re: Profiling after exit()

2018-03-06 Thread Martin Nowak via Digitalmars-d-learn
On Thursday, 27 July 2017 at 15:16:35 UTC, Eugene Wissner wrote: Are there profilers that work well with dmd? valgrind? OProfile? Yes, any sampling profiler works fine, e.g. perf on linux, Intel VTune/AMD CodeXL on Windows. Those directly monitor CPU performance counters and have a

Re: Profiling after exit()

2017-07-28 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-07-28 11:30, Mario Kröplin wrote: Our programs are intended to run "forever". 24/7 servers. What's wrong with having a bool that determines if the loop should continue running? -- /Jacob Carlborg

Re: Profiling after exit()

2017-07-28 Thread Mario Kröplin via Digitalmars-d-learn
On Friday, 28 July 2017 at 09:02:10 UTC, Temtaime wrote: There's no "gracefully" way to kill a thread. If your thread cannot join, then you're doing something wrong Our programs are intended to run "forever". 24/7 servers.

Re: Profiling after exit()

2017-07-28 Thread Temtaime via Digitalmars-d-learn
On Friday, 28 July 2017 at 08:06:33 UTC, Eugene Wissner wrote: On Friday, 28 July 2017 at 06:32:59 UTC, Jacob Carlborg wrote: On 2017-07-27 16:30, Eugene Wissner wrote: I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile

Re: Profiling after exit()

2017-07-28 Thread Eugene Wissner via Digitalmars-d-learn
On Friday, 28 July 2017 at 06:32:59 UTC, Jacob Carlborg wrote: On 2017-07-27 16:30, Eugene Wissner wrote: I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile the code with -profile, send a SIGTERM and call exit(0) from my

Re: Profiling after exit()

2017-07-28 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-07-27 16:30, Eugene Wissner wrote: I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile the code with -profile, send a SIGTERM and call exit(0) from my signal handler to exit the program. The problem is that I get the

Re: Profiling after exit()

2017-07-27 Thread Mario Kröplin via Digitalmars-d-learn
On Thursday, 27 July 2017 at 14:44:31 UTC, Temtaime wrote: Also there was an issue that profiling doesn't work with multi-threaded apps and leads to a crash. Don't know if it is fixed. Was fixed two years ago: http://forum.dlang.org/post/mia2kf$djb$1...@digitalmars.com

Re: Profiling after exit()

2017-07-27 Thread Eugene Wissner via Digitalmars-d-learn
On Thursday, 27 July 2017 at 14:52:18 UTC, Stefan Koch wrote: On Thursday, 27 July 2017 at 14:30:33 UTC, Eugene Wissner wrote: I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile the code with -profile, send a SIGTERM and

Re: Profiling after exit()

2017-07-27 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 27 July 2017 at 14:30:33 UTC, Eugene Wissner wrote: I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile the code with -profile, send a SIGTERM and call exit(0) from my signal handler to exit the program. The

Re: Profiling after exit()

2017-07-27 Thread Temtaime via Digitalmars-d-learn
Also there was an issue that profiling doesn't work with multi-threaded apps and leads to a crash. Don't know if it is fixed.

Re: Profiling after exit()

2017-07-27 Thread Temtaime via Digitalmars-d-learn
Exit is not "normal exit" for D programs so, do not use it. Your threads should stop at some point to make able the app exit successfully. There's a "join" method. You can use it with your "done" variable.

Re: Profiling Windows App and DLL

2017-07-23 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 17 July 2017 at 20:36:58 UTC, Igor wrote: I also tried "Very Sleepy" profiler but it only shows symbols for main application and not for the DLL that it loads which is also built with debug info. Something that works very well is CPU profiling with CodeXL. It used to be an

Re: Profiling Windows App and DLL

2017-07-23 Thread Rainer Schuetze via Digitalmars-d-learn
On 17.07.2017 22:36, Igor wrote: Is there a known limitation in profiling these or am I doing something wrong? When I try to run my application from VisualD (x64 build) with -profile switch I just get Access Violation reported on WinMain function (actual declaration, it doesn't enter its

Re: Profiling calls to small functions

2017-01-22 Thread albert-j via Digitalmars-d-learn
I'm not sure if it's what happening in this case but, in code as simple as this, function calls can sometimes be the bottleneck. You should see how compiling with/without -O affects performance, and adding `pragma(inline)` to funcB. I guess my question is whether it is possible to have

Re: Profiling calls to small functions

2017-01-21 Thread albert-j via Digitalmars-d-learn
I'm not sure if it's what happening in this case but, in code as simple as this, function calls can sometimes be the bottleneck. You should see how compiling with/without -O affects performance, and adding `pragma(inline)` to funcB. When compiled with -inline, the profiler does not report the

Re: Profiling calls to small functions

2017-01-21 Thread pineapple via Digitalmars-d-learn
On Saturday, 21 January 2017 at 12:33:57 UTC, albert-j wrote: Now I dmd -profile it and look at the performance of funcA with d-profile-viewer. Inside funcA, only 20% of time is spend in funcB, but the rest 80% is self-time of funcA. How is it possible, when funcB has three times the

Re: profiling issues

2014-09-12 Thread Vlad Levenfeld via Digitalmars-d-learn
Awesome! These are exactly what I was looking for. Thanks!

Re: Profiling

2014-01-26 Thread Benjamin Thaut
On Saturday, 25 January 2014 at 15:34:57 UTC, Philippe Sigaud wrote: On Fri, Jan 24, 2014 at 10:25 PM, Benjamin Thaut c...@benjamin-thaut.de wrote: What Plattform are you profiling on? Linux 32bits. Does it change something? I'm not using any OS-specific part of Phobos, AFAICT. Doesn't

Re: Profiling

2014-01-25 Thread Philippe Sigaud
On Fri, Jan 24, 2014 at 10:25 PM, Benjamin Thaut c...@benjamin-thaut.de wrote: What Plattform are you profiling on? Linux 32bits. Does it change something? I'm not using any OS-specific part of Phobos, AFAICT.

Re: Profiling

2014-01-24 Thread Dmitry Olshansky
24-Jan-2014 20:31, Philippe Sigaud пишет: I'm trying to use the `-profile` flag for DMD and, without any documentation, I can't really understand the resulting log files: * They contain only mangled names. Is there a way to get demangled, human-readable symbols? pipe it though ddemangle tool.

Re: Profiling

2014-01-24 Thread Brad Roberts
Please file a bug on this. The docs should be on dlang.org. On 1/24/14 11:15 AM, Dmitry Olshansky wrote: 24-Jan-2014 20:31, Philippe Sigaud пишет: I'm trying to use the `-profile` flag for DMD and, without any documentation, I can't really understand the resulting log files: * They contain

Re: Profiling

2014-01-24 Thread Philippe Sigaud
On Fri, Jan 24, 2014 at 8:35 PM, Brad Roberts bra...@puremagic.com wrote: Please file a bug on this. The docs should be on dlang.org. Here it is: https://d.puremagic.com/issues/show_bug.cgi?id=11985

Re: Profiling

2014-01-24 Thread Benjamin Thaut
Am 24.01.2014 17:31, schrieb Philippe Sigaud: I'm trying to use the `-profile` flag for DMD and, without any documentation, I can't really understand the resulting log files: * They contain only mangled names. Is there a way to get demangled, human-readable symbols? * Can someone tell me what

Re: Profiling graph library

2013-08-01 Thread Joseph Rushton Wakeling
On 07/31/2013 02:31 PM, bearophile wrote: If this resulting array is used only for a short period of time: return sequence.map!(x = x.func).array; Just to compare, I tried rewriting the cacheing version of the neighbours() function to use this kind of sequence. Here's the original code:

Re: Profiling graph library

2013-07-31 Thread Joseph Rushton Wakeling
On 07/31/2013 01:02 AM, bearophile wrote: Also try to use a bitvector from Phobos instead of bool[]. I take it you mean std.bitmanip.BitArray ... ? I ran into some interesting problems which are probably down to incomplete implementation: e.g. myBitArray.length += n; ... results in a

Re: Profiling graph library

2013-07-31 Thread bearophile
Joseph Rushton Wakeling: I take it you mean std.bitmanip.BitArray ... ? Right. I ran into some interesting problems which are probably down to incomplete implementation: e.g. myBitArray.length += n; ... results in a compiler error message: myBitArray.length() is not an lvalue

Re: Profiling graph library

2013-07-31 Thread Joseph Rushton Wakeling
On 07/31/2013 02:31 PM, bearophile wrote: Then I suggest to try ldc2 too. I haven't profiled with ldc2 yet (I will) but the broad speed tendencies are similar. It's faster but not so much faster that I can assume the speed hit isn't still there. My suggestion is to copy the implementation of

Re: Profiling graph library

2013-07-31 Thread bearophile
Joseph Rushton Wakeling: But most likely the best compromise solution is as you suggest a buffer, with the instruction .dup the result if you want it to be persistent. In my library code often I do the opposite: I add a template boolean switch named as doCopy that defaults to true. If it's

Re: Profiling graph library

2013-07-30 Thread bearophile
There are many ways to design a graph data structure. All of them have tradeoffs, they can't be very good for everything. For your benchmarks are you using the ldc2 compiler with correct compilation switches? map() should not allocate memory. Sometimes lazy code is faster and sometimes it's

Re: Profiling graph library

2013-07-30 Thread John Colvin
On Tuesday, 30 July 2013 at 23:02:40 UTC, bearophile wrote: Sometimes you can keep memory allocation low, performance almost acceptable, and code easy to read using a pre-allocated scratch space plus using map() and copy() from std.algorithm. Any chance of some nice examples of this?

Re: Profiling graph library

2013-07-30 Thread bearophile
John Colvin: Any chance of some nice examples of this? Allocate a buffer somewhere, on the stack or heap, and then instead of using a map()+array() as in that code use map()+copy() plus a test to be sure the space is sufficient. But in the end I don't know how much well even ldc2 will

Re: Profiling graph library

2013-07-30 Thread Joseph Rushton Wakeling
On 07/31/2013 01:02 AM, bearophile wrote: There are many ways to design a graph data structure. All of them have tradeoffs, they can't be very good for everything. Sure, it's just that in this case the reference code (igraph) is _much_ more performant. I'm keen to try and identify the major

Re: Profiling

2012-12-07 Thread Jonathan M Davis
On Friday, December 07, 2012 19:49:30 js.mdnq wrote: Is there a standard library that makes profiling easy and accurate? e.g., profile.start(); ... writeln(profile.end()); where profile.end() can has some nicely printed string to output(like xxm xxs xxms)? The compiler has a

Re: profiling with -profile

2012-07-26 Thread Minas Mina
Sorry, I just saw the generated file... :p