February 25, 2021
On Monday, 22 February 2021 at 11:57:46 UTC, Johan Engelen wrote:
> This article explains the basics: https://www.snsystems.com/technology/tech-blog/clang-time-trace-feature

Thank you! I opened the trace of my project in chrome://tracing and found that the majority of semantic analysis was spent on instantiations of `std.conv: text`. I replaced them and compilation time went down from 2.1 to 1.6 seconds, which I think is a big win!

> There is definitely room for improvement, but it requires user feedback and consideration of their different use cases.

I'm already happy with what is there, but so far the most annoying part is that chrome's viewer is terribly slow and unresponsive. It can easily take a minute to load a trace, after which it runs at 1 frame per second, so I'm looking for an alternative.

The article mentions Speedscope, but my first impression isn't that great: it's still slow, and the interface is not self-explanatory unlike Chrome's.

In the PR you mentioned tracy*, but I'm still looking at how to compile it for Linux since the release only seems to include Windows binaries. I guess I'll try it out on Windows first.

*https://github.com/ldc-developers/ldc/pull/3624#issuecomment-735446453
February 26, 2021
On Thursday, 25 February 2021 at 19:57:04 UTC, Dennis wrote:
>
> In the PR you mentioned tracy*, but I'm still looking at how to compile it for Linux since the release only seems to include Windows binaries. I guess I'll try it out on Windows first.
>
> *https://github.com/ldc-developers/ldc/pull/3624#issuecomment-735446453

If it's the regular client, then just cd to https://github.com/wolfpld/tracy/tree/master/profiler/build/unix and run `make`. We use it on Linux without problem, but the profiler crashes on Mac OSX ATM.
February 26, 2021
On Friday, 26 February 2021 at 01:10:48 UTC, Mathias LANG wrote:
> If it's the regular client, then just cd to https://github.com/wolfpld/tracy/tree/master/profiler/build/unix and run `make`. We use it on Linux without problem, but the profiler crashes on Mac OSX ATM.

I had to `sudo apt install libcapstone-dev`, but after that it worked!
So for others, my current Debian-linux setup looks like this:

```
# Go to your code folder and clone tracy:
git clone https://github.com/wolfpld/tracy

# Build the import-chrome tool
cd tracy/import-chrome/build/unix/
make
# Copy it to the /usr/bin folder so it can be invoked from anywhere
sudo cp import-chrome-release /usr/bin/import-chrome

# Back to the root of the repo, now build the profiler
cd ../../../
cd profiler/build/unix/
make
sudo cp Tracy-release /usr/bin/tracy
```

Now add these settings to dub.sdl (either temporarily for all builds, or inside a specific configuration):
```
dflags "--ftime-trace" platform="ldc"
dflags "--ftime-trace-file=./my-trace.json" platform="ldc"
postBuildCommands "import-chrome ./my-trace.json ./my-trace.tracy" platform="ldc"

```

Then build and open the trace:
```
dub build --compiler=ldc2
tracy my-trace.tracy
```
And enjoy 60 fps!
1 2
Next ›   Last »