Não sei se você percebeu mas com a nova RTTI disponível desde o Delphi 2010 os executáveis gerados ficam muito grande.
Se você não tira proveito da RTTI não precisa deste peso.
http://delphi.about.com/b/2011/07/26/create-smaller-delphi-xe-executables-remove-rtti-pack-exe.htm?nl=1
O segredo está na diretiva de compilação WEAKLINKRTTI que no estado "on" desliga a RTTI. :)
Se estivermos nesta situação e precisarmos da RTTI receberemos a seguinte erro:
---------------------------
Debugger Exception Notification
---------------------------
Project Small.exe raised exception class EInsufficientRtti with message 'Insufficient RTTI available to support this operation'.
---------------------------
Break Continue Help
---------------------------
Mais sobre o assunto:
http://docwiki.embarcadero.com/RADStudio/en/WEAKLINKRTTI_directive_(Delphi)
http://docwiki.embarcadero.com/RADStudio/en/RTTI_directive_(Delphi)
Veja um código simples:
program Small;
{$APPTYPE CONSOLE}
//Pulo do gato!
{$WEAKLINKRTTI ON}
uses
SysUtils, Rtti;
type
//Aqui temos um controle mais fino
{$RTTI EXPLICIT METHODS([vcPublic])}
TMinhaClasse = class(TObject)
public
procedure Teste;
end;
{ TMinhaClasse }
procedure TMinhaClasse.Teste;
begin
Writeln('Ola mundo!');
Readln;
end;
var
LContext : TRttiContext;
LType : TRttiType;
oTeste : TMinhaClasse;
begin
try
oTeste := TMinhaClasse.Create;
LContext := TRttiContext.Create;
LType := LContext.GetType(TMinhaClasse);
LType.GetMethod('Teste').Invoke(oTeste,[]);
oTeste.Free;
except
on E: Exception do
begin
Writeln(E.ClassName, ': ', E.Message);
Readln;
end;
end;
end.