Sign in

Clément Grégoire

@lectem.bsky.social
132 followers 234 following 139 posts

French C++ developer, consultant & co-founder @ siliceum. Performance optimization, multithreading, rendering APIs and game engines. I know too much about Webkit and JS for my own good. I do reverse engineering for fun!

PostsRepliesMedia
Clément Grégoire @lectem.bsky.social · 22/09/2026
Me trying Linux again this year. "disable secure boot" "use manual partinionning" "installer crashed" Year of Linux desktop my ass
030
Clément Grégoire @lectem.bsky.social · 25/05/2026
Wtf @anthropic.com
000
Clément Grégoire @lectem.bsky.social · 06/05/2026
Given how bad and slow Opus results are lately, I wouldn't be surprised if @anthropic.com pulled the old mechanical turk trick on us and hired an army of Indian devs to prompt smaller models to save on costs.
000
Clément Grégoire @lectem.bsky.social · 20/03/2026
Of course this also means that every single AI was trained with this, and it adds even more TOCTOU issues...
000
Clément Grégoire @lectem.bsky.social · 20/03/2026
I keep seeing `if(file_exists(path)) do_something(path)` and similar. This infuriates me. STOP FUCKING DOING 2 SYSCALLS THIS IS BOTH SLOW AND NON ATOMIC. FFS please... I've even seen it in teaching materials, do everyone a favor and read en.wikipedia.org/wiki/Time-of...
en.wikipedia.org
Time-of-check to time-of-use - Wikipedia
130
Clément Grégoire @lectem.bsky.social · 17/03/2026
At least in userland you can actually get saved by the kernel 😂
010
Clément Grégoire @lectem.bsky.social · 17/03/2026
Oh I'm not blaming the kernel, every lock internally starts as a spinlock... And this is a very hard place to get code right given it executes user code in kernel mode 😅 I'm just amused such issues can appear there too, and will definitely use it next time someone shows me a (bad) spinlock!
110
Clément Grégoire @lectem.bsky.social · 17/03/2026
And @rovarma.bsky.social even kindly linked to my article☺️
121
Clément Grégoire @lectem.bsky.social · 17/03/2026
Oh mah! Look, spinlocks are at it again (this time in the kernel, there's no escape!)
120
Clément Grégoire @lectem.bsky.social · 23/02/2026
I was going to say the same thing, they make it look like this was hard while Linux had RCU for more than 20years now 🤷
010
Clément Grégoire @lectem.bsky.social · 12/02/2026
Oh nice it makes sense! Sounds like a lot of work and tiny details to get that working. Wonder if you'll be able to optimize out things such as spinloops :p So in theory even allocations are expected to be "stable" and replay at the same memory address? Cool!
110
Clément Grégoire @lectem.bsky.social · 12/02/2026
Oh I think I get it now(or maybe not), you need to replay from scratch/dump then? Then the tool will fake/replay kernel interactions? I suppose it requires so kind of determinism of the code in the first place? I suppose "records... intrinsics" means you record atomic operations too?
120
Clément Grégoire @lectem.bsky.social · 12/02/2026
Yeah, access to old versions has been like this for a while sadly... Good luck 😅
010
Clément Grégoire @lectem.bsky.social · 12/02/2026
Sounds nice! But my first questions with time travel debugging are always : - what's the overhead? - how long ago can I go in the past on big games? (for example UE based) - what about gpu sync?
200
Clément Grégoire @lectem.bsky.social · 12/02/2026
Well there's download.cnet.com/intel-vtune-... but it seems a bit too old 😅 Good luck!
download.cnet.com
Intel VTune Amplifier for Windows - Free download and software reviews - CNET Download
Download Intel VTune Amplifier latest version for Windows free to try. Intel VTune Amplifier latest update: February 29, 2024
100
Clément Grégoire @lectem.bsky.social · 12/02/2026
You'd lack most other perf counters provided by vtune though.
100
Clément Grégoire @lectem.bsky.social · 12/02/2026
You could probably add it to tracy pretty "easily" since we already support it on Linux, you'd only need to add it to the kernel etw session and do the proper translation to Tracy's event buffers.
100
Clément Grégoire @lectem.bsky.social · 12/02/2026
Well, my guess is that it's mostly under documented. ETW can collect certain PMU events since win8 I believe, but for those not known to ETW you need driver support. It also (iirc) only allows sampling, not direct access through code.
100
Clément Grégoire @lectem.bsky.social · 03/02/2026
I've long been opposed to exceptions for reasons, but I have to admit there are use cases. I don't really agree with most of what is said in the article, but it does make some points. cedardb.com/blog/excepti...
cedardb.com
Why I Prefer Exceptions to Error Values
CedarDB is a database system that delivers unmatched performance for transactions and analytics, from small writes to handling billions of rows. Built on cutting-edge research to power today’s tools a...
000
Clément Grégoire @lectem.bsky.social · 30/01/2026
Dear frontend developers: Stop fucking using buttons instead of links! I want to be able to copy, open in new tab,... Well, have links be links and not buttons. Thanks.
010
Clément Grégoire @lectem.bsky.social · 27/01/2026
Ever wrote spin-locks or had to debug them? I have, and I got tired of seeing (and writing) crappy ones, so I did a real investigation this time. Spoiler: trust your OS. siliceum.com/en/blog/post...
siliceum.com
Spinning around: Please don't! - siliceum
Embark on a journey about why you should sometimes trust your OS more than yourself.
1239
Clément Grégoire @lectem.bsky.social · 04/01/2026
Can we all agree that OpenSSL sucks by requiring perl to build in 2026? I'm not even asking for CMake support, just no stupid dependencies!
010
Clément Grégoire @lectem.bsky.social · 23/12/2025
Cup arrived right before Christmas, thanks @matt.godbolt.org
010
Clément Grégoire @lectem.bsky.social · 20/12/2025
It's getting harder and harder to optimize for new CPUs, we now have NUMA on consumer CPUs...
000
Reposted by Clément Grégoire
Sebastian Aaltonen @sebaaltonen.bsky.social · 16/12/2025
My "No Graphics API" blog post is live! Please repost :) www.sebastianaaltonen.com/blog/no-grap... I spend 1.5 years doing this. Full rewrite last summer and another partial rewrite last month. As Hemingway said: "First draft of everything is always shit".
sebastianaaltonen.com
No Graphics API — Sebastian Aaltonen
Graphics APIs and shader languages have significantly increased in complexity over the past decade. It’s time to start discussing how to strip down the abstractions to simplify development, improve pe...
19474193
Clément Grégoire @lectem.bsky.social · 10/12/2025
Did I mention I hate the webdev ecosystem ?
010
Clément Grégoire @lectem.bsky.social · 09/12/2025
Luckily the @vite.dev's team got it right in rollup... so it's time for us to switch to rollup and dump esbuild. Still, web dev sucks.
000
Clément Grégoire @lectem.bsky.social · 09/12/2025
As if it was not already wasteful for Objects imports (this is only really needed for non-Object types)... It creates one such object PER file doing any import, even if you only need 1 export from the original ! Now let's say you have a SDK with ~780 exports & 171files... That's 120000 functions!
100
Clément Grégoire @lectem.bsky.social · 09/12/2025
Today a new episode of "Web sucks"! When handling import of an external library, ESBuild generates some kind of import table for the whole library. But since it needs to mimick ESM modules, it creates the "exports" object using Getters instead of properties.
100
Clément Grégoire @lectem.bsky.social · 08/12/2025
Movie you’ve watched more than six times with a gif. Hard mode: no Stars (Wars nor Trek), LOTR, or Marvel, Disney Animated or Pixar.
media.tenor.com
a man is petting a small black dog in his arms .
ALT: a man is petting a small black dog in his arms .
020
Clément Grégoire @lectem.bsky.social · 03/12/2025
Nice to finally see the busy/wait/idle for gpu queues, bubbling was a major issue for a previous client of mine (mitigated by fixing the command list merging, I think it's now OK upstream)
010
Clément Grégoire @lectem.bsky.social · 03/12/2025
Depends on your OS, on Linux it's easy, on windows you need to juggle with power plans (I've got an internal tool for that, I need to release someday...)
010
Clément Grégoire @lectem.bsky.social · 03/12/2025
Yep, same as the CPU and other things. Though it still matters to sometimes profile without stabilizing your machine as it's the "end-user experience", and things such as power change latency can actually kill the perf of your app. But 90%of the time please do stabilize your machine.
120
Clément Grégoire @lectem.bsky.social · 02/12/2025
Mine started by finding yet another bad spinlock in a widely used library.
010
Clément Grégoire @lectem.bsky.social · 02/12/2025
If you do try it out or already use it I'd be interested in the results!
100
Clément Grégoire @lectem.bsky.social · 02/12/2025
I'm afraid it's less exciting than it sound, it's basicly just caching! I've seen some reports (don't remember where exactly) that it does slow down the collection somehow (I didn't verify) gist.github.com/Zhentar/7f3f...
gist.github.com
Unlocking the secrets of ETW: Stack Caching
Unlocking the secrets of ETW: Stack Caching. GitHub Gist: instantly share code, notes, and snippets.
110
Clément Grégoire @lectem.bsky.social · 02/12/2025
Interesting! I did a similar experiment in the past for another profiler but never finished it. Note you could even pack your pages by storing bidepth and numelements in the upper 12bits of your data pointers :)
000
Clément Grégoire @lectem.bsky.social · 02/12/2025
Well, there is actually an option to compress callstacks, but depending on your workload it might not save much space. (I have a link to something related somewhere, if you're interested)
120
Clément Grégoire @lectem.bsky.social · 27/11/2025
Even the minigames shipped on the minidiscs were kind of good for the time
010
Clément Grégoire @lectem.bsky.social · 14/10/2025
"But look at that horrible microsoftism declspec(dllexport), it's so annoying and hard to understand with those macros!" - some1 in the 90s "Everything should be visible cause code is open and it aligns with my political views" - Another one, from GNU. "This is dumb" - the one banned from GNU
020
Clément Grégoire @lectem.bsky.social · 13/10/2025
And then they openly blame devs for poor perfs.. . I blame them for poor tooling and bad optimizations.
000
Clément Grégoire @lectem.bsky.social · 13/10/2025
So UE5 has a tool that generates perf reports, with a whole Metadata generation thing (in XML) that allows to customize reports. But it still displays averages for timings everywhere. Oh, and their perf bench tool is implemented using 3layers of different technologies.
110
Clément Grégoire @lectem.bsky.social · 23/09/2025
Finally took the time to buy a licence for Fork. Truly the best UI for git, as it's the only one that never disappointed me. It's only missing Linux support but otherwise well worth its price. @fork_dev@mastodon.social
000
Clément Grégoire @lectem.bsky.social · 13/09/2025
UE5 disk size is insane, you need at least 2TB to be safe for a single small/mid-size project.
110
Clément Grégoire @lectem.bsky.social · 08/08/2025
Just saw this has been fixed, thanks a lot, for that and the Rss feeds!
000
Clément Grégoire @lectem.bsky.social · 07/08/2025
New blog post about my journey into the ETW depths, I had long wanted to look into it, now I'm starting to regret it (just a bit). But this is great if you want to write your own tools for profiling! www.siliceum.com/en/blog/post...
siliceum.com
ETW Events and thread names - siliceum
Thread names are one of the most crucial information one can get system activity. However Windows ETW does not make it easy to retrieve!
021
Clément Grégoire @lectem.bsky.social · 01/08/2025
Ahah, if it's too much work don't bother 😉
000
Clément Grégoire @lectem.bsky.social · 01/08/2025
Nice! Would it be possible to add a RSS feed to your blog? Helps me keep track of new posts!
120
Clément Grégoire @lectem.bsky.social · 11/07/2025
@openvibe.social the app is really great except for one thing killing the experience for me on android: No way to copy a link or open it on your browser because you hide the webview toolbar!
120
Clément Grégoire @lectem.bsky.social · 26/06/2025
It is indeed the initial goal! But for some applications you do need it to be somewhat accurate! In any case, what I'm most bothered by is the fact that behavior really changes under load.
110