Twitxy Saved

Aliaksandr Valialkin

Verified account This account is verified. Learn more

@valyala

Joined November 2010
1.2K Following 4.7K Followers 3.4K Posts

Latest posts 5

Aliaksandr Valialkin Verified account @valyala
This is exactly my experience with AI-assisted coding.
Valentin Ignatev Verified account @valigo 3d
Was reviewing Claude's code and noticed a sus-looking if condition. Ask it what is this, and it dumped a 2 paragraphs of some very plausible bullshit. If I hadn't known this part of the codebase by heart (because I wrote it by hand) I would've taken it.

But I pushed back and told it how it's supposed to be. After it "You're absolutely right"ed me - it did the change, but also changed come completely unrelated code, because, in its opinion, it follows a similar pattern (it's not, there is only some superficial similarity).

I got so triggered by it (it was towards the end of the day and I was already kinda tired) that I just rage-nuked all unstaged changes and started rewriting it all by hand. It wasn't much, about 150 lines of code, but while rewriting it my eyes fell on some other code, unrelated to the task, that tingled my spidey-sense. And indeed - there was a bug, actual user-facing bug, and the only reason I spotted it is because it was on the way of me manually navigating to the part I actually needed.

This makes me think how many other opportunities to improve the project I miss when I only look at the diffs.
View quoted post on X
33 replies 41 reposts 1.4K likes 333K views View on X
Aliaksandr Valialkin Verified account @valyala
Don't underestimate the power of grep. I use it frequently when working with the code. I run "git grep" for finding all the lines in the repository, which mention the given identifier - this can be function name, type name, global variable name, metric name, API path, query argument, url, etc.

Contrary to AI and IDE, "git grep" always finds all the needed lines across all the files in the repository - source code, comments, documentation, Docker files, Makefiles, etc. So you can be confident that your code changes cover all the relevant places across all the repository.

P.S. Your source code must have good greppability in order to take advantage of "git grep". This means it must use unique global identifiers, so you could easily grep them. This isn't hard to achieve, and this also improves code readability and maintainability.
5 replies 3 reposts 43 likes 1.9K views View on X
Aliaksandr Valialkin Verified account @valyala
TIL: you can increase hot loop performance by 20x by properly exploiting store forwarding property on modern CPUs. And Go better fits than Rust for achieving this performance boost, since it doesn't automatically reorder struct fields.
Daniel Lemire Verified account @lemire 5d
You can get a massive performance penalty if your code does not take into account store forwarding. x.com/i/article/2118…
View quoted post on X
8 replies 7 reposts 177 likes 14K views View on X
Aliaksandr Valialkin Verified account @valyala
@func25 published new explainer video on how VictoriaLogs stores data on disk in order to provide high query performance over hundreds of terabytes of logs. Highly recommended to view!
How does logs database like VictoriaLogs store data on disk to support fast queries over terabytes of logs?

youtube.com/live/Ok4D_80QC…
View quoted post on X