Can nice D code get a bit slow?
FeepingCreature
feepingcreature at gmail.com
Wed Mar 8 15:49:27 UTC 2023
On Wednesday, 8 March 2023 at 10:49:32 UTC, Markus wrote:
> So, having no clue about D (just bought some books), I wanted
> to ask if nice looking code can become slow, in general. In the
> mentioned case it's just that I like the packaging of functions
> into some sort of scope (OOP) versus the flat C and Go stuff. I
> like OOP for this reason, but now I'm unsure whether I might
> stay out of creating classes at all.
>
> Uh, hope you understand my vague question, sorry about that. I
> found D to be the right place because it's not missing any
> essential feature I know of.
>
> Kind regards
If you write D like Java, it will be slow like Java - actually
slower, because D's GC isn't as good.
If you remember to use structs for value types (no `class
Vector3f`, `class Point` etc.), you should be fine.
Though as a general rule, don't worry about it too much. Even
slow D is still fast.
More information about the Digitalmars-d-learn
mailing list