News for hackers. Stuff that matters.
Re:Show HN: A HN clone writen in go by ilyt on Sunday March 05, 2023 @06:07PM (#35035209)
> 1. Go has a major bottleneck and that’s the growth of its memory size when it’s under pressure. Templates bloat the memory quickly and make the site less performant at scale (aka if you put it on Heroku, you’d need more Dinos to support the traffic, which costs more.). Instead of GO templating, you can produce static pages and fill them up with JS Ajax or React, or whatever your front end flavor is and make that call a Go API you produce with the framework instead. This also helps you turn your site into an app if needed as well.

It will most likely be fast enough. If not there are libs that will compile your templates to Go code with very minimal overhead, or templating libraries that are much faster than builtin one.

I'd think adding megabytes of JS garbage just to run site would be opposite of "HN clone"

Re:Show HN: A HN clone writen in go by fbdab103 on Sunday March 05, 2023 @10:23PM (#35037184)
Amen to that. Half the reason I like this site is it loads instantly. Not showing spinning wheels just to display some text.

As for "working at scale", this post itself is id ~35 million. You could likely fit all of that into ram on a modestly sized server.

Re:Show HN: A HN clone writen in go by ilyt on Monday March 06, 2023 @07:29AM (#35040205)
It's idiotic complaint really. I switched from Go templates to pre-compiled ones because of engineering wankery of personal project where I wanted to have page render take less than 1ms, and with templates it took like 3-4ms. Even with something complex at say 50ms per page you're looking at ~200req/sec/core which is a lot of traffic
Re:Show HN: A HN clone writen in go by Ylmaz on Monday March 06, 2023 @06:44AM (#35039888)
I have to agree with you. I see this as a tendency for sites to start getting back to basics. Large frontend frameworks often cause more problems than they solve.