About Simon's mail: Can be faster if ooRexx5 is built withInterprocedural optimization (IPO), also known as link-time optimization (LTO)
See mail Enrico 09/08/2020
Attached patch: IPO-CMakeLists.txt.patch |
IPO-CMakeLists.txt.patch
Description: Binary data
T(12) do outerCounter = 1 until currNum >= 999999999999
Answer....: 7822873594199 ooRexx 4.2 Elapsed...: 9.867650 seconds ooRexx 5.2 Elapsed...: 9.096634 seconds ooRexx 5.2 Elapsed...: 8.400673 seconds (IPO)
T(13) do outerCounter = 1 until currNum >= 9999999999999
Answer....: 7822873594199 ooRexx 4.2 Elapsed...: 36.143888 seconds ooRexx 5.2 Elapsed...: 33.380404 seconds ooRexx 5.2 Elapsed...: 30.940000 seconds (IPO)
Test suite without IPO rexx testOORexx.rex -X native_api File search: 00:00:01.206683
Suite construction: 00:00:01.040363
Test execution: 00:05:16.749802
Total time: 00:05:19.561522
Test suite with IPO rexx testOORexx.rex -X native_api File search: 00:00:01.283647
Suite construction: 00:00:00.519720
Test execution: 00:04:56.374620
Total time: 00:04:58.657757
Begin forwarded message:
Subject: Re: [rexxla-members] Project Euler - Challenge # 932 - Can you make it run faster?
Date: 20 November 2025 at 01:09:57 CET
Hello Mark,
Long time no "talk".
|
The following is my answer/solution, the complete program script:
/* Interpreter: Open Object Rexx Version 4.2.0 | Build date: Feb 22 2014 | Addressing Mode: 32 Finished in 3728.644000 seconds = 1 hour and 2 minutes Interpreter: REXX-Regina_3.8.2 5.00 22 Jun 2014 (32 bit) Finished in 4808.967000 seconds = 1 hour and 20 minutes Operating/S: Windows 11 Pro | Version 10.0.26200.7171 Hardware : PC with Intel Core i7-8750H @ 2.20GHz | 16 GB RAM */ call time 'R' answer = 0 currNum = 9 currDiff = 7 numeric digits 17 do outerCounter = 1 until currNum >= 9999999999999999 currNum = currNum + currDiff currDiff = currDiff + 2 currNLm1 = length(currNum) - 1 do digitPos = 1 to currNLm1 tN = substr(currNum, digitPos + 1) / 1 if tN = 0 then iterate
if (left(currNum, digitPos) + tN) ** 2 \= left(currNum, digitPos) || tN then iterate
answer = answer + currNum iterate outerCounter end end
say 'Answer....:' answer say 'Elapsed...:' time('E') 'seconds' return
Cheers, -Simon @ Nashville, Tennessee Hi Simon,
I think you need to be logged into that site to view the actual problem. Without a login you are presented with the About page.
Cheers, Mark
--
_._,_._,_
Groups.io Links:
You receive all messages sent to this group.
View/Reply Online (#2853) |
Reply to Group
| Reply to Sender
|
Mute This Topic
| New Topic
----------
RexxLA relies on donations to cover costs. Please consider donating at: https://donorbox.org/donations-to-rexx-language-association
Your Subscription |
Contact Group Owner |
Unsubscribe
[ [email protected]]
_._,_._,_
|
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel