[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 01:59:40 PST 2024


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/66514 at github.com>


tbaederr wrote:

> > > Here are the results for a quick implementation of check points: http://llvm-compile-time-tracker.com/compare.php?from=12e425d0cf9bca072c7b2138e50acbc5f1cd818c&to=99f3a7853f9fa83bffe3b4d04e41e744169d426a&stat=instructions:u
> > > With a little more fiddling: http://llvm-compile-time-tracker.com/compare.php?from=12e425d0cf9bca072c7b2138e50acbc5f1cd818c&to=0ee6dd17747818b05a1d504e4916ce46ef061226&stat=instructions:u
> > 
> > 
> > Imo this is reasonable, we should go in that direction. It's not free but it is predictable
> > Further improvements:
> > * cache the lookup of `CheckPoints[FID]` as it should not change between calls to `BeginSourceFile`
> > * Play with reserve and/or dequeue
> 
> Yeah, I like the direction it heads with checkpoints. The implementation is pretty straight-forward, the performance is pretty consistent (and doesn't seem to add significant overhead). Just for comparison though, how does the stress test from the re-lexing approach perform with checkpoints? I expect we'll still see an increase in compile times but hopefully not "took more than an hour" levels of increase.

Before any of the changes in this PR:
```
real    0m9.909s
user    0m0.934s
sys     0m8.945s
```

with highlighting:
```
real    1m3.245s
user    0m53.403s
sys     0m9.682s
```

with the changes, but no highlighting, i.e. only the preprocessor changes:
```
real    0m10.032s
user    0m0.937s
sys     0m9.064s
```



https://github.com/llvm/llvm-project/pull/66514


More information about the cfe-commits mailing list