speeding up fastscript ...

edited 9:04PM in FastScript
I have found a way to get significant speedups when calling external procedures and functions!

Since FastScript is using CreateVarArray to pass parameters to CallMethod, I've changed VarArray to simple array of variant! Altough I needed to change delcarations all over ... I was amazed ... 500% speedup!

I still didn't discover any incompatibilites. It works well for me ...

So here's the code :

change "var Params: variant" in TfsCallMethodEvent to "var Params: array of variant"

//

function TfsMethodHelper.GetValue: Variant;
var
v: array of Variant;
i: Integer;
s: String;
Instance: TObject;
begin
if Assigned(FOnCall) then
begin
SetLength(v, Count);
for i := 0 to Count - 1 do
v := Params.Value;

s := Name;
if FIndexMethod then
s := s + '.Get';

Instance := nil;
if ParentValue <> Null then
Instance := TObject(Integer(ParentValue));

Result := FOnCall(Self.FProgram, Instance, FClassRef, {Ansi}UpperCase(s), v);
for i := 0 to Count - 1 do
if Params.IsVarParam then
Params.Value := v;
SetLength(v, 0);

end
else
Result := 0;
end;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.