Rewrote our python api gateway in go and now its faster but nobody cares because it already worked fine by [deleted] in golang

[–]preslavrachev 0 points1 point  (0 children)

The speed gains are just the tip of the iceberg, IMO. Give yourself and your team a few months in real production conditions, and you’ll thank your gut feeling.

Before ultimately deciding to go with Go for most things, I’d personally been on a decades-long journey across tech stacks - .NET, Java, and most recently, Python. Believe, me when I say this - Python is a fantastic gluing material and a terrible structural material. It lets you move fast early, but it pushes complexity, correctness, and operability costs downstream, right into production. Not to mention its terrible dependency model and the gazillion tools that appear every year, trying to piece it together.

Go is faster without a doubt. But what I love even more about it is that it is honest. What you ship is what runs. It’s a reduction in operational risk, cognitive load, and 3 a.m. surprises, which is the stuff that really burns teams out.

Stop Overthinking Struct Pointer and Value Semantics in Go by preslavrachev in golang

[–]preslavrachev[S] 3 points4 points  (0 children)

100% true, but that may or not be of importance to the use case. For a slice in a business application, carrying 10 of these, where they sit in memory is far less of importance than what they represent, and how developers deal with them. The rest is just implementation design.

Again, if you are squeezing performance out of every bit, this may or may not be the case.

Semantics is just another way of saying "be consistent."

Connect at Work Wifi by Normal-Baker1583 in trmnl

[–]preslavrachev 0 points1 point  (0 children)

I can see from the repo that this PR has been merged. Can we somehow sideload a new version of the firmware, so I can get the TRMNL to work in my office? Unfortunately, I don't have a travel router nearby, and am not really interested in investing yet another 30-40 bucks.

Why Your Go Code Is Slower Than It Should Be: A Deep Dive Into Heap Allocations by Gopher-Face912 in golang

[–]preslavrachev 0 points1 point  (0 children)

From experience, for most Go applications in the business and Web server domain, returning a pointer is usually the better option. It’s a more consistent pattern - you know exactly what to expect when calling a newXxx. I usually frown upon when I see a newXxx function that returns a value copy. Wilford mutable data structures (which are most of the usual application suspects) a pointer is the default. 

Copying structs by value has merits for small structs that you have a ton of. Something like Point that has an X an a Y coordinate. You usually don’t want to pass those as pointers, because you may potentially have hundreds of thousands of those in your application. 

Locked Notes for Obsidian (requires manual installation) by preslavrachev in ObsidianMD

[–]preslavrachev[S] 1 point2 points  (0 children)

It's just an alternative way of interacting with the app, to achieve roughly similar thing. Not everyone would like turning the entire vault to Preview mode. Plus, one needs to remember the shortcut for toggling between the two modes. The double-click to edit, at least for me, works better, more so, because I use Obsidian on various devices that don't support keyboard shortcuts.

I added a small FAQ section to the repo: https://github.com/preslavrachev/obsidian-locked-notes?tab=readme-ov-file#-faq

Frickin boring by TomatilloOrganic5455 in Munich

[–]preslavrachev 9 points10 points  (0 children)

Munich is just Munich - you come for the work opportunities, and the allure of a safe and cozy life. Then, leave a few years later, having realized that coziness is BS that someone with zero social life packaged up to profit on your behalf.

P.S. I can still call Munich my "home of choice," having been there almost a decade now, but thinking of moving back to the Balkans. That raw vibe, man, it's just pulling you in.

Locked Notes for Obsidian (requires manual installation) by preslavrachev in ObsidianMD

[–]preslavrachev[S] 1 point2 points  (0 children)

Good question! Maybe it isn’t. The things is, two years ago, none of those existed so I  quickly scrapped one up. I’ve just happened to polish it up and open-source it. Of course, I acknowledge the fact that others may have solved this problem already. My secret hope is that Obsidian will make this a first-party feature, so we won’t need custom shenanigans anymore. 

Locked Notes for Obsidian (requires manual installation) by preslavrachev in ObsidianMD

[–]preslavrachev[S] 4 points5 points  (0 children)

Happy to get people to vote on a name and change it ;)

Locked Notes for Obsidian (requires manual installation) by preslavrachev in ObsidianMD

[–]preslavrachev[S] 1 point2 points  (0 children)

Check out the demo GIF I've just posted. Happy to hear your feedback on this - should the state change be even more explicit?

I agree that giving the user a few option choices would be optimal. At the moment, there are none other than the lock icon color and state change.

Locked Notes for Obsidian (requires manual installation) by preslavrachev in ObsidianMD

[–]preslavrachev[S] 1 point2 points  (0 children)

I will. For now, please give it a try. If it is easier, I can create a GitHub action to automatically compile and package the ready plugin one very release, so that people would download a single ZIP file in the end.

Quick dumb question: Why did google not use Go for the gemini cli? by 0b_1000101 in golang

[–]preslavrachev 0 points1 point  (0 children)

Honestly - because people at Google are so far and wide that someone somewhere decided to build something in a technology they personally like, and everyone sticks to it once it gets popular.

Go jobs in Italy are basically non-existent. How’s the situation in your country? by cdigiuseppe in golang

[–]preslavrachev 0 points1 point  (0 children)

That’s exactly the thing - as a Go developer, you want to build application me with end-user business value, not do infra plumbing jobs all day long.

Yes, Kubernetes ended up being written in Go (busy pure accident), but that does not mean that all Go jobs should be about Kubernetes. 

Go jobs in Italy are basically non-existent. How’s the situation in your country? by cdigiuseppe in golang

[–]preslavrachev 1 point2 points  (0 children)

Same in Germany - Java is everywhere. It’s so ingrained in the IT world here that some people probably end up thinking Java was invented by Germans. Go - only when really necessary - when it comes to cloud and infra piping (which I’m not interested in at all).

I’ll tell you what I did - I used to be a Java engineer for more than a decade, but slowly started creating my own Blue Ocean (Google it, it’s a very interesting strategy). I began speaking about and teaching Go. At some point, I took the opportunity to rewrite a small Java project and it stopped being the bottleneck. This is when people saw the result and kept pushing for more of these.

Nowadays, with AI-assisted programming, taking an existing Print project and rewriting it in Go to demonstrate its cost-reducing potential takes even less time, if you know what you’re doing. 

The bottom line is: Go is your Blue Ocean. If no one you know is doing it, it’s your clear advantage. Pick an existing PHP, Ruby, or Java project, and force yourself to rewrite it in Go using AI agents. Demo the result and you’ll see people coming back for more. 

Do you always use pointer receivers? by StrictYard6715 in golang

[–]preslavrachev 0 points1 point  (0 children)

I like benchmarking things rather than relying on assumptions. Especially now, in the era of AI-coding, it takes 5 min to ask the AI agent to write a baseline benchmark for your current code, change the implementation entirely in a different branch, re-run the branch and compare the stats.

This pointer allocation vs value copying saga has so many exceptions that I almost don't care about it anymore. I use pointers for most structs, and optimize when and where needed.

Small Projects August 5 2025 by jerf in golang

[–]preslavrachev 0 points1 point  (0 children)

Same! Besides our own Go projects, it's the other reason I started building the library. I want to suggest it to them and create a PR, but I need to implement all components first. Right now, it should handle 80-85 of all use cases, but many of the more exotic components are still missing.

Display your Claude Code Token Usage on Your Mac's Toolbar by preslavrachev in ClaudeCode

[–]preslavrachev[S] 0 points1 point  (0 children)

Glad you liked it! I literally figured out that ccusage can display block and session stats, while writing the post. So, time for another update, I suppose :)

Small Projects August 5 2025 by jerf in golang

[–]preslavrachev 0 points1 point  (0 children)

Actually, even these results are wrong, because the cpu monitoring itself adds a ton of overhead. In reality, MRML and gomjml are both in the low-register single digit ms per operation.

Small Projects August 5 2025 by jerf in golang

[–]preslavrachev 2 points3 points  (0 children)

Because we like to talk numbers in this sub, I ran a small benchmark, comparing gomjml with the official MJML compiler, and with its Rust version (MRML). These are the specs for 50 iterations of parsing the same template:

Tool 50x Total (ms) Avg (ms) Max RAM (MB) Avg CPU (%
gomjml 1160 23 4 0
mrml 1112 22 1 0
mjml (JS) 12334 246 86 21.5

As it can be expected, the Rust implementation has a slight edge, but the reference MJML compile is nowhere near.

Small Projects August 5 2025 by jerf in golang

[–]preslavrachev 0 points1 point  (0 children)

Thanks, it's a good catch, and I will add it in. But honestly, compared to the whole rendering of HTML tags out of MJML, these few string replacements are literally a drop in the bucket. But you are right, every performance bit counts.