Is there a real performance increase when disabling {$ IMPORTEDDATA}?

Is there a real performance increase when disabling {$ IMPORTEDDATA}?

the manual says only the following: "The {$ G-} directive disables the creation of imported data references. Using {$ G-} increases memory access efficiency, but prevents a packed unit where it arises from variable references in other packages."


Update:

Here is more information I could find:

โ€œThere's a new option in the Debugging section. Use imported data links (mapped to $ G) that control the creation of imported data links (improves memory efficiency but prevents access to global variables defined in other runtime packages)โ€

+5
source share
1 answer

Almost never

This directive only applies to accessing global unit variables from another device.

If you use {$ G +}

unit1;

interface

var
  Global1: integer;   //<--  this is a global var in unit1.
  Form1: TForm1;      //<--  also a global var, but really a pointer

Global1will be accessible indirectly with the help of the pointer (if, and when accessed from outside unit1)
Form1, the indirect (i.e., a change from a direct pointer to an indirect pointer) will also be available.

if you use {$ G-}, access to an integer globalwill be direct and therefore a little faster.

This will only matter if you use the variables of the global public device in another block and in a temporary critical code, i.e. Almost never.

: http://hallvards.blogspot.com/2006/09/hack13-access-globals-faster.html

+4

All Articles