Hi,

I've compared 2 ways of converting enum identifier strings to enum value:
- implemented with a manual associative array: 45ms
- implemented by std.conv.to: `name.to!Enum()`: 1299ms

(batch= 500_000, I tested with looking up the Segoe MDL2 Asset symbol characters)

Anyone can tell me how std.to() is doing the conversion, is it using the simplest way: linear search?
Can anyone point it out in the sources?

I have no luck finding it in std.conv, it's quite big. I've only found the opposite way.

Thanks in advance.
  • str.to!Enum perf... realhet via Digitalmars-d-learn
    • Re: str.to!... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: str... realhet via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
          • ... H. S. Teoh via Digitalmars-d-learn
          • ... realhet via Digitalmars-d-learn
          • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
      • Re: str... Johan via Digitalmars-d-learn
    • Re: str.to!... Per Nordlöw via Digitalmars-d-learn

Reply via email to