Re: [Oorexx-devel] ooRexx Performance

2020-08-09 Thread Enrico Sorichetti via Oorexx-devel
To squeeze a bit of performance REXX should be built with the   Interprocedural 
optimization (IPO)  activated

My tests showed an increase in performance between 5 and 8 %

Use the make module CheckIPOSupported 
And if supported define the property  for the relevant   
set_property( TARGET ……….  PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE )

( the Rexx executable, the rexx library , the rexxapi library , the rxapi  
executable the rexxc executable  )  

 pretty easy 

Cheers

E


> On 9 Aug 2020, at 14:24, René Jansen  wrote:
> 
> on behalf of James R. Manchester, xjmanc...@gmail.com 
>  :
> 
> Is there something in ooRexx that limits its use of the CPU within Windows?  
> I have an application that should use 100% of the CPU but only manages about 
> 20%.  The following program runs for 60 seconds and it should use the CPU 
> continuously.  However, according to Task Manager, it doesn't quite use 22%.  
> What's limiting the use of the CPU?  Is there some setting which can be used 
> to change this behavior?
> 
> Regards,
> Jim Manchester
> 
> /* */
> 
> Duration = 60--Number of seconds to execute.
> 
> Start = Time('S')-- Get the start time.
> 
> i = 0
> do forever
>   a = 1234 * 24536
>   b = a / 25
>   c = a * b
>   Elapsed = Time('S') - Start
>   i += 1
>   if Elapsed > Duration then
>   leave
>   end
> 
> say 'There were' i 'iterations in ' Elapsed 'seconds.'
> 
> exit
> 
> 
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] ooRexx Performance

2020-08-09 Thread CVBruce
That sounds about right 90% of one cpu is 22.5%

In my experiments on a 4 core raspberry pi, I could drive 3 cores to 95%+ and 
the last core to about 75%.  Jim could try running 4 concurrent copies of his 
program to verify this.  Another issue, is that if you drive the cpu so hard 
that it starts to over heat, throttling may occur to reduce the thermal load.

Bruce

> On Aug 9, 2020, at 9:05 AM, Mike Cowlishaw  wrote:
> 
> My guess is that his machine is not one CPU but 4-core, so this single-thread 
> program is using [a bit less than] a quarter of the CPU.
> 
> Mike
> 
>> From: René Jansen [mailto:rvjan...@xs4all.nl]
>> Sent: 09 August 2020 13:24
>> To: Open Object Rexx Developer Mailing List
>> Cc: James R. Manchester
>> Subject: [Oorexx-devel] ooRexx Performance
>> 
>> on behalf of James R. Manchester, xjmanc...@gmail.com 
>>  :
>> 
>> Is there something in ooRexx that limits its use of the CPU within Windows?  
>> I have an application that should use 100% of the CPU but only manages about 
>> 20%.  The following program runs for 60 seconds and it should use the CPU 
>> continuously.  However, according to Task Manager, it doesn't quite use 22%. 
>>  What's limiting the use of the CPU?  Is there some setting which can be 
>> used to change this behavior?
>> 
>> Regards,
>> Jim Manchester
>> 
>> /* */
>> 
>> Duration = 60--Number of seconds to execute.
>> 
>> Start = Time('S')-- Get the start time.
>> 
>> i = 0
>> do forever
>> a = 1234 * 24536
>> b = a / 25
>> c = a * b
>> Elapsed = Time('S') - Start
>> i += 1
>> if Elapsed > Duration then
>> leave
>> end
>> 
>> say 'There were' i 'iterations in ' Elapsed 'seconds.'
>> 
>> exit
>> 
>> 
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel



signature.asc
Description: Message signed with OpenPGP
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] ooRexx Performance

2020-08-09 Thread Mike Cowlishaw
My guess is that his machine is not one CPU but 4-core, so this
single-thread program is using [a bit less than] a quarter of the CPU.
 
Mike


  _  

From: René Jansen [mailto:rvjan...@xs4all.nl] 
Sent: 09 August 2020 13:24
To: Open Object Rexx Developer Mailing List
Cc: James R. Manchester
Subject: [Oorexx-devel] ooRexx Performance


on behalf of James R. Manchester, xjmanc...@gmail.com : 

Is there something in ooRexx that limits its use of the CPU within Windows?
I have an application that should use 100% of the CPU but only manages about
20%.  The following program runs for 60 seconds and it should use the CPU
continuously.  However, according to Task Manager, it doesn't quite use 22%.
What's limiting the use of the CPU?  Is there some setting which can be used
to change this behavior? 

Regards,
Jim Manchester


/* */

Duration = 60--Number of seconds to execute.

Start = Time('S')-- Get the start time.

i = 0
do forever
a = 1234 * 24536
b = a / 25
c = a * b
Elapsed = Time('S') - Start
i += 1
if Elapsed > Duration then
leave
end

say 'There were' i 'iterations in ' Elapsed 'seconds.'

exit

 
 

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] ooRexx Performance

2020-08-09 Thread Rick McGuire
He probably has a multi core machine, so oorexx is just using most of the
processing power of one core.

On Sun, Aug 9, 2020 at 8:25 AM René Jansen  wrote:

> on behalf of James R. Manchester, xjmanc...@gmail.com :
>
> Is there something in ooRexx that limits its use of the CPU within
> Windows?  I have an application that should use 100% of the CPU but only
> manages about 20%.  The following program runs for 60 seconds and it should
> use the CPU continuously.  However, according to Task Manager, it doesn't
> quite use 22%.  What's limiting the use of the CPU?  Is there some setting
> which can be used to change this behavior?
>
> Regards,
> Jim Manchester
>
> /* */
>
> Duration = 60--Number of seconds to execute.
>
> Start = Time('S')-- Get the start time.
>
> i = 0
> do forever
> a = 1234 * 24536
> b = a / 25
> c = a * b
> Elapsed = Time('S') - Start
> i += 1
> if Elapsed > Duration then
> leave
> end
>
> say 'There were' i 'iterations in ' Elapsed 'seconds.'
>
> exit
>
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Creating routine/method from a compiled and encoded Rexx program supplied as a string array

2020-08-09 Thread Rony G. Flatscher
While in the process of creating a test unit, I stumbled over the following 
shortcoming:
PROGRAMSCOPE is not set if using newFile for .routine or .method, the enclosed 
two test programs
demonstrate this.

Indeed, if the routine or the method get created from a file (no matter whether 
compiled or not) the
last argument in LanguageParser::create{Method|Routine|Program} named 
"sourceContext" does not get
applied. How would one apply that to the method/routine objects that get 
returned from the restore
routines?

---rony


On 07.08.2020 13:23, Rony G. Flatscher wrote:
>
> Just updated  with a new patch 
> (adds support in
> LanguageParser::createProgram(), simplifies code a little bit more) and test 
> files going with it.
>
> ---rony
>
>
> On 07.08.2020 12:21, Rony G. Flatscher wrote:
>> On 07.08.2020 00:02, Rick McGuire wrote:
>>> Been without power here since Tuesday and probably won’t have power until 
>>> the weekend, so I
>>> won’t be able to review anything.
>>
>> Wow, sorry to hear that! All the best!
>>
>> ---
>>
>> In the process of updating the patch (missed createProgram(), simplifying 
>> code a little bit more).
>>
>> ---rony
>>
>>
>>>
>>> On Thu, Aug 6, 2020 at 1:51 PM Rony G. Flatscher >> > wrote:
>>>
>>> Please review the fixes.
>>>
>>> If there are no objections I will apply the patch of #1716 (it also 
>>> includes the patch for
>>> bug #1715) together with test units to test for them.
>>>
>>> ---rony
>>>
>>>
>>> On 06.08.2020 19:47, Rony G. Flatscher wrote:

 The bug report in 
  includes a patch that 
 fixes this.

 ---rony


 On 05.08.2020 15:16, Rony G. Flatscher wrote:
>
> Having received error reports from users of BSF4ooRexx like
>
>  2 *-* /**/@
> Error 13 running 
> rexx_invoked_via_[fxml_01.fxml]_at_2020_08_05T12_33_24_17Z.rex line 2:  
> Invalid character in program.
> Error 13.1:  Incorrect character in program "@" ('40'X).
>
> and looking up the execution paths in those cases, it turns out that 
> the ooRexx .routine
> class gets used to create the executable in those cases with a string 
> array representing
> the compiled and encoded Rexx program.
>
> So the "new" method of the .routine class gets the compiled and 
> encoded source supplied as
> an array of strings, e.g.:
>
> #!/usr/bin/env rexx
> /**/@REXX@
> 
> LyoqL0BSRVhYAGcrKgAgVOwAAABwEgAAVPq7VhgC
> 
> gB68ViACKABwOADkSrxWOAIFAACA
> ... cut ...
>
> Supplying the compiled and encoded data as a single string to the 
> .routine class does not
> work as this issues the error "13.1, Invalid character in program" 
> caused by the presence
> of a LF ('0A'x) character, here a rexxtry example:
>
> infile=.stream~new("nutshell_01.rex-compiled")~~open("read")
>   ... rexxtry.rex on 
> WindowsNT
> pgm=infile~charin(infile~chars)
>   ... rexxtry.rex on 
> WindowsNT
> infile~close
>   ... rexxtry.rex on 
> WindowsNT
> r1=.routine~new("aha",pgm)
>   Oooops ! ... try again. Invalid character in program.
>   Incorrect character in program "
> " ('0A'X).
>   rc = 13.1 . rexxtry.rex on 
> WindowsNT
>
> As a compiled and encoded form of a Rexx program always has the 
> string "/**/@REXX@" as the
> value for its second line it would be possible to determine that the 
> String array comes
> from a compiled and encoded Rexx program. Rather than creating an 
> error in this case, the
> routine object could get created successfully from the String array 
> representing a
> compiled and encoded Rexx program.
>
> Are there any objections to try to enhance the "new" method of the 
> .routine (and the
> .method) class such that the string array can represent a compiled 
> and encoded Rexx program?
>
> ---rony
>

say ".routine's NEW has 'PROGRAMSCOPE'..."
say "1) creating routine 'r1' from string array using .routine's NEW method..."
r1=.routine~new("r1",.resources~testCode)
say "2) calling routine 'r1' without arguments:" r1[]
say "3) calling routine 'r1' with 3 arguments:"  r1[a,b,c]
say "---"
say

fn="r2_test.rex"
call sysFileDelete fn
.stream~new(fn)~~open("write 

[Oorexx-devel] ooRexx Performance

2020-08-09 Thread René Jansen
on behalf of James R. Manchester, xjmanc...@gmail.com 
 :

Is there something in ooRexx that limits its use of the CPU within Windows?  I 
have an application that should use 100% of the CPU but only manages about 20%. 
 The following program runs for 60 seconds and it should use the CPU 
continuously.  However, according to Task Manager, it doesn't quite use 22%.  
What's limiting the use of the CPU?  Is there some setting which can be used to 
change this behavior?

Regards,
Jim Manchester

/* */

Duration = 60--Number of seconds to execute.

Start = Time('S')-- Get the start time.

i = 0
do forever
a = 1234 * 24536
b = a / 25
c = a * b
Elapsed = Time('S') - Start
i += 1
if Elapsed > Duration then
leave
end

say 'There were' i 'iterations in ' Elapsed 'seconds.'

exit

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel