Re:Simple techniques to optimise Go programs
by tick_tock_tick on Tuesday June 18, 2019 @02:37PM
(#20216746)
I find the exact opposite for rust as it often encourages boxing random objects to satisfy odd lifetimes.
That being said of course in almost all of these case you can restructure your program so you don't need to box the values but if it's not performance critical why bother? Repeat a couple dozen times across a large codebase and you have the same pointer chasing issues.
Re:Simple techniques to optimise Go programs
by the_duke on Tuesday June 18, 2019 @02:51PM
(#20216904)
The NLL improvements of last year have improved things quite a bit. It's still not perfect, but in my opinion it has reached a point where this is mostly an issue for Rust beginners.
Some patterns of writing code will be really awkward to realize, but there are usually "more rusty" solutions that you start to apply without event noticing. Once you write code with the desired ownership semantics in mind, it's often (relatively) frictionless.
Re:Simple techniques to optimise Go programs
by pjmlp on Thursday June 20, 2019 @02:52AM
(#20230524)
It is still an issue for doing UI related coding, due to the way it is common to design such kind of systems.
Re:Simple techniques to optimise Go programs
by firethief on Tuesday June 18, 2019 @02:28PM
(#20216644)
> This is one of the reasons I really love Rust: it not-so-subtly nudges you towards avoiding heap allocations by adding extra boilerplate and making them obvious in type signatures (unless you hide them behind wrapper types).
Could you clarify this? It seems like the opposite to me. Borrowing requires lifetimes in type signatures, but boxing yields owned objects, which can be passed around easily like value types.
This contributes to Rust programs generally having good performance characteristics without spending time on optimizations.