Help optimize D solution to phone encoding problem: extremely slow performace.

Daniel Kozak kozzi11 at gmail.com
Sat Jan 20 00:35:44 UTC 2024


On Fri, Jan 19, 2024 at 4:44 PM H. S. Teoh via Digitalmars-d-learn <
digitalmars-d-learn at puremagic.com> wrote:

> Taking a look at this code:
> ...


> Try addressing the points I wrote above and see if it makes a
> difference.
>
>
I have tried it (all of it) even before you wrote it here, because I have
completely the same ideas, but to be fair it has almost zero effect on
speed.
There is my version (It still use OOP, but I have try it wit Printer and
Counter to be structs and it has no effect at all)
https://paste.ofcode.org/38vKWLS8DHRazpv6MTidRJY

The only difference in speed in the end is caused by hash implementation of
dlang associative arrays and rust HashMap, actually if you modify rust to
not used ahash it has almost same speed as D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20240120/83635e54/attachment.htm>


More information about the Digitalmars-d-learn mailing list