Speeding up importing Phobos files

Vladimir Panteleev thecybershadow.lists at gmail.com
Mon Jan 21 09:02:01 UTC 2019


On Monday, 21 January 2019 at 08:11:22 UTC, Walter Bright wrote:
> On 1/20/2019 10:21 PM, Vladimir Panteleev wrote:
>> This might get you some speed for the first compilation (fewer 
>> directory entry lookups), but I would expect that follow-up 
>> compilations to have a negligible overhead, compared to the 
>> CPU time needed to actually process the source code.
>
> In my benchmarks with Warp, the slowdown persisted with 
> multiple sequential runs.

Would be nice if the benchmarks were reproducible.

Some things to consider:

- Would the same result apply to Phobos files?

   Some things that could be different between the two that would 
affect the viability of this approach:

   - Total number of files
   - The size of the files
   - The relative processing time needed to actually parse the 
files

     (Presumably, a C preprocessor would be faster than a full D 
compiler.)

- Could the same result be achieved through other means, 
especially those without introducing disruptive changes to 
tooling? For example, re-enabling the parallel / preemptive 
loading of source files in DMD.

Using JAR-like files would be disruptive to many tools. Consider:

- What should the file/path error message location look like when 
printing error messages with locations in Phobos?
- How should tools such as DCD, which need to scan source code, 
adapt to these changes?
- How should tools and editors with a "go to definition" function 
work when the definition is inside an archive, especially in 
editors which do not support visiting files inside archives?

Even if you have obvious answers to these questions, they still 
need to be implemented, so the speed gain from such a change 
would need to be significant in order to justify the disruption.



More information about the Digitalmars-d mailing list