4 ms·
Compiled Delphi unit files include a serialisation of the symbol table. Import definitions are not included. There's an import symbol for each import that has
by barrkel 6y ago
Compiled Delphi unit files include a serialisation of the symbol table.
Import definitions are not included. There's an import symbol for each import that has a pointer to the definition information which is updated when the used unit is loaded. This linking is fast, and uses a combo of three things: hash code, symbol name and symbol version. Hash codes in the Delphi compiler are cached in each symbol, so each symbol linked is a hash probe and a few string compares at most. The symbol version is a hash of its (original) definition. If there's a version mismatch, Delphi knows it needs to recompile the unit.
(I spent about 6 years working on the compiler at Borland / Codegear / Embarcadero.)