On Sunday, 7 September 2025 at 12:29:08 UTC, Robert Schadek wrote:
I spend one day at dconf this year and removed wstring and dstring support from std.format to improve compile speed. std.format.FormatSpec is no longer a template on the character type, and the bitfield template was removed as well.

The dub package can be found here https://code.dlang.org/packages/std2_format
https://github.com/burner/std2.format

When compiling the below format call with ldc and -ftime-trace
```
import std2.format;
//import std.format;

void main(){
    string s = format("Hello %s %s %.2f", "World", 1337, 13.37);
    assert(s == "Hello World 1337 13.37", s);
}

```

The overall compile time decreases from 290ms to 223ms and the frontend time for
the format call goes from 71ms to 23ms.

Currently, alias this and toString tests fail. And I can't really figure out why.
Also some float tests fails.

PR's are always welcome.

Meta: Removing wstring and dstring support from std.format for phobos 3 should be looked at IMHO.

wouldnt be far faster to just rip out all the c api complexity and just do a simple sane api?

  • std.format wi... Robert Schadek via Digitalmars-d-announce
    • Re: std.... monkyyy via Digitalmars-d-announce
      • Re: ... Robert Schadek via Digitalmars-d-announce
        • ... monkyyy via Digitalmars-d-announce
    • Re: std.... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
      • Re: ... H. S. Teoh via Digitalmars-d-announce
      • Re: ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
        • ... H. S. Teoh via Digitalmars-d-announce
    • Re: std.... H. S. Teoh via Digitalmars-d-announce
    • Re: std.... IchorDev via Digitalmars-d-announce
      • Re: ... Dom DiSc via Digitalmars-d-announce

Reply via email to