Comments for Somewhere Within Boredom https://withinboredom.info A Site About Stuff Sun, 18 Aug 2024 12:28:34 +0000 hourly 1 https://wordpress.org/?v=6.7.1 Comment on Optimizing CGO handles by cavokz https://withinboredom.info/2024/08/12/optimizing-cgo-handles/#comment-286 Tue, 13 Aug 2024 10:24:05 +0000 https://withinboredom.info/?p=5356#comment-286 You may consider https://pkg.go.dev/runtime#Pinner, it allows you to pin down a Go object so that you can pass its pointer to CGO without fear of it becoming invalid.

I don’t know how expensive it is to pin down something but it should scale up quite nicely and does not require any synchronization by itself.

]]>
Comment on Hacking PHP’s WeakMap for Value Object D× by Lars Moelleken https://withinboredom.info/2024/07/10/hacking-phps-weakmap-for-value-object-dx/#comment-274 Thu, 11 Jul 2024 22:55:39 +0000 https://withinboredom.info/?p=5286#comment-274 I tried to fix the same problem with static analysis, so you are not allowed to use value-objects in conditions: https://github.com/voku/phpstan-rules : classesNotInIfConditions

Bests Lars

]]>
Comment on Golang is evil on shitty networks by withinboredom https://withinboredom.info/2022/12/29/golang-is-evil-on-shitty-networks/#comment-241 Tue, 14 May 2024 19:25:23 +0000 https://withinboredom.info/?p=4691#comment-241 In reply to ValdikSS.

This was done, though it wasn’t mentioned. All roaming was disabled. There’s local radar and lots of reflections around me, so most likely it was interference.

]]>
Comment on Golang is evil on shitty networks by ValdikSS https://withinboredom.info/2022/12/29/golang-is-evil-on-shitty-networks/#comment-240 Fri, 10 May 2024 09:00:01 +0000 https://withinboredom.info/?p=4691#comment-240

It turns out there are random 50-100ms delays all over the place. Probably due to interference.

No, it’s probably periodic background scanning of other networks. Try to “lock” your connection to your network mac address only to prevent that.

]]>
Comment on Golang is evil on shitty networks by withinboredom https://withinboredom.info/2022/12/29/golang-is-evil-on-shitty-networks/#comment-171 Fri, 06 Jan 2023 22:15:24 +0000 https://withinboredom.info/?p=4691#comment-171 In reply to Kevin Sproule.

The idea isn’t to have it on for the entire request but turn it off when doing bulk transfers if and only if you aren’t filling packets (lots of small writes). If you’re filling packets, it doesn’t matter unless there is congestion after slow-start.

]]>
Comment on Golang is evil on shitty networks by Kevin Sproule https://withinboredom.info/2022/12/29/golang-is-evil-on-shitty-networks/#comment-170 Tue, 03 Jan 2023 05:16:16 +0000 https://withinboredom.info/?p=4691#comment-170 Not have TCP_NODELAY set really increases the latency of network traffic. Back in the day we needed to make sure TCP_NODELAY was set to get maximum performance.

]]>
Comment on Golang is evil on shitty networks by Dusan Jovanovic (DBJ) https://withinboredom.info/2022/12/29/golang-is-evil-on-shitty-networks/#comment-168 Fri, 30 Dec 2022 15:16:54 +0000 https://withinboredom.info/?p=4691#comment-168 Technicaly it’s not a languages fault, but it’s std lib.

]]>
Comment on Golang is evil on shitty networks by Pyth0n https://withinboredom.info/2022/12/29/golang-is-evil-on-shitty-networks/#comment-167 Fri, 30 Dec 2022 12:41:09 +0000 https://withinboredom.info/?p=4691#comment-167 I had an unpleasant experience with core Go developers “knowing best”. They listen patiently to your all pros and cons and then say “we know better” and leave as-is.
My issue was the total inability for Go to negotiate AES-256 in TLS 1.3 for Go client connecting to Go server. AES-128 has hardwired non-configurable higher precedence, and you can’t do anything about that. Their answer was “AES-128 is secure enough, stop wasting our time”. I ended up writing software in Rust…

]]>
Comment on Golang is evil on shitty networks by funny_falcon https://withinboredom.info/2022/12/29/golang-is-evil-on-shitty-networks/#comment-166 Fri, 30 Dec 2022 11:03:20 +0000 https://withinboredom.info/?p=4691#comment-166 Yep: if you use Golang’s io you almost MUST use bufio wrappers around. If git-lfs didn’t that that’s could be really considered as a bug.

Nagle’s algorithm by itself is a pure evil. I’ve never seen any production highload system that didn’t set TCP_NODELAY on its sockets. That is why Golang did it by default. It is good decision.

But that means one should always buffer its io. It is always good thing to buffer it in userspace. Nagle’s algorithm were born for those program’s that for some reason couldn’t do it. That it because telnet/ssh were single threaded, and they didn’t have a way to “wait for user input for some more and flush buffer after N ms either there was user input or not”. (Well, they could use SIGALARM, but for some reason they didn’t). Instead Nagle’s algorithm were introduced to work around their shortcomings, and by misfortune it were made as the default for all sockets.

]]>
Comment on Golang is evil on shitty networks by Waleed Khan https://withinboredom.info/2022/12/29/golang-is-evil-on-shitty-networks/#comment-164 Fri, 30 Dec 2022 08:21:51 +0000 https://withinboredom.info/?p=4691#comment-164

each of those 50 bytes are sent out as one packet instead of just a few bigger packets

This wording is confusing, since “one packet” is surely fewer than “a few packets”. It should probably say “sent out as individual packets”.

]]>