Re: [fpc-pascal] Why external execution so slow? (fixed)

2020-04-03 Thread Marco van de Voort


Op 2020-04-01 om 23:49 schreef Bart via fpc-pascal:



I think I'll put this under a special porunidle option in trunk and fpc
3.2.0 , so to only trigger this when needed.

Hmm..
porunidle -> poRunIdle (to be consistent in namegiving)?

Done.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Why external execution so slow? (fixed)

2020-04-03 Thread Marco van de Voort


Op 2020-04-02 om 08:45 schreef Gabor Boros:

2020. 04. 01. 17:21 keltezéssel, Marco van de Voort írta:
But at least FPC3.2.0rc1 has a rewritten tprocess/runcommand that 
makes this fixable without source changes and recompilation, look at 
the next example:



It's fast but FPC's help not showed on the screen.

It needs an addiional "writeln(os)", but here it work fine. Note that I 
also changed the drive letter of the fpc executable to suit my different 
configuration.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Why external execution so slow? (fixed)

2020-04-01 Thread Gabor Boros

2020. 04. 01. 17:21 keltezéssel, Marco van de Voort írta:
But at least FPC3.2.0rc1 has a rewritten tprocess/runcommand that makes 
this fixable without source changes and recompilation, look at the next 
example:



It's fast but FPC's help not showed on the screen.

Gabor
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Why external execution so slow? (fixed)

2020-04-01 Thread Bart via fpc-pascal
On Wed, Apr 1, 2020 at 5:22 PM Marco van de Voort
 wrote:

> I think I'll put this under a special porunidle option in trunk and fpc
> 3.2.0 , so to only trigger this when needed.

Hmm..
porunidle -> poRunIdle (to be consistent in namegiving)?

Bart



-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Why external execution so slow? (fixed)

2020-04-01 Thread Marco van de Voort


Op 2020-04-01 om 09:59 schreef Gabor Boros:

2020. 03. 31. 19:37 keltezéssel, Gabor Boros írta:

RunCommandInDir('E:\FPC\3.2.0\bin\i386-win32','fpc.exe',['-h'],OS,[]);


Tried with modified(fpc -h) "Reading large output" example 
(https://wiki.freepascal.org/Executing_External_Programs#Reading_large_output). 
It's lighting fast. I will rewrite external execution in my real 
application based on this example...


I found out the problem. TProcess was modified for long running 
processes to not consume too much CPU.


I think I'll put this under a special porunidle option in trunk and fpc 
3.2.0 , so to only trigger this when needed.


But at least FPC3.2.0rc1 has a rewritten tprocess/runcommand that makes 
this fixable without source changes and recompilation, look at the next 
example:


{$mode delphi}

uses classes,sysutils,process;

type
   TNoSleepProcess = class(TProcess)
    constructor Create (AOwner : TComponent);override;
    end;

constructor TNoSleepProcess.Create (AOwner : TComponent);
begin
  inherited;
  RunCommandSleepTime:=0; // rest the default sleep time to 0 (context 
switch only)

end;

var
  Start:TDateTime;
  OS:String;
begin
  DefaultTProcess:=TNoSleepProcess; // set as system wide (!) tprocess 
class for runcommand() variants

  Start:=Now;
RunCommandInDir('d:\FPC\3.0.4\bin\i386-win32','fpc.exe',['-h'],OS,[poUsePipes]);
  WriteLn(FormatDateTime('nn:ss.zzz',Now-Start));
end.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal