When reading/parsing data from disk often try to write code such as

    foreach (const line; File(filePath).byLine)
    {
        auto s = line.splitter(" ")

        const x = s.front.to!uint; s.popFront;
        const y = s.front.to!double; s.popFront;
        ...
    }

In response to all the discussions regarding performance problems related to the GC I wonder if there are plans to implement data-flow analysis in DMD that can detect that the calls to s.front in the example above doesn't need to use the GC. This because their references aren't used outside of the foreach scope (Escape Analysis).

Reply via email to