Potential of a compiler that creates the executable at once
max haughton
maxhaton at gmail.com
Sun Feb 13 00:47:38 UTC 2022
On Sunday, 13 February 2022 at 00:41:38 UTC, Walter Bright wrote:
> On 2/12/2022 9:20 AM, max haughton wrote:
>> I'm specifically talking about the file that handles elf
>> files, it's very messy and uses some absolutely enormous
>> structs which are naturally very slow by virtue of their size.
>
> The elf generator was written nearly 30 years ago, and has
> never been refactored properly to modernize it. It could sure
> use it, but I'm not so sure it would speed things up noticeably.
>
> If you want to take a crack at it, feel free!
It's on my list.
The reason why it's slow is because the structs are very large
compared to a cacheline so the CPU has to pull in
(optimistically, the CPU might pull in several lines at once) 64
bytes but only uses about 10 of them in a given iteration.
There is an O(n^2) algorithm in there but I'm not sure it's a
particularly big N in normal programs.
More information about the Digitalmars-d
mailing list