On Friday, 12 October 2018 at 23:32:34 UTC, Nicholas Wilson wrote:
On Friday, 12 October 2018 at 20:12:26 UTC, Stanislav Blinov
That's done first and foremost by stripping out unnecessary
allocations, not by writing "new" every other line and closing
your eyes.
If you need perf in your _scripts_, a use LDC and b) pass -O3
which among many other improvements over baseline will promote
unnecessary garbage collection to the stack.
If you *need* perf, you write performant code. If you don't need
perf, the least you can do is *not write* lazy-ass pessimized
crap.
I mean come on, it's 2018. We're writing code for multi-core
and multi-processor systems with complex memory interaction.
We might be sometimes. I suspect that is less likely for a
script to fall in that category.
Jesus guys. *All* code falls in that category. Because it is
being executed by those machines. Yet we all oh so like to
pretend that doesn't happen, for some bizarre reason.
Precisely where in memory your data is, how it got there and
how it's laid out should be bread and butter of any D
programmer. It's true that it isn't critical for one-off
scripts, but so is deallocation.
Saying stuff like "do more with GC" is just outright harmful.
That is certainly not an unqualified truth. Yes one shouldn't
`new` stuff just for fun, but speed of executable is often not
what one is trying to optimise when writing code, e.g. when
writing a script one is probably trying to minimise
development/debugging time.
That's fine so long as it doesn't unnecessarily *pessimize*
execution. Unfortunately, when you advertise GC for it's
awesomeness in your experience with "throwaway" scripts, you're
sending a very, *very* wrong message.
Kids are reading, for crying out loud.
Oi, you think thats bad? Try reading what some of the other
Aussies post, *cough* e.g. a frustrated Manu *cough*
:)