SUBSTR and STRIP Performance Gains #470
Closed
Peter-Jacob
started this conversation in
Show and tell
Replies: 4 comments 2 replies
|
This is the REXX I used for the comparison: |
0 replies
|
Hi Peter,
unfortunately, lots of other testcases fail now on macOS:
13 - db_decimal_tests (Failed)
18 - ts_c2x-rxvm (Failed)
19 - ts_c2x-rxbvm (Failed)
30 - ts_d2x-rxvm (Failed)
31 - ts_d2x-rxbvm (Failed)
34 - ts_date2-rxvm (Failed)
35 - ts_date2-rxbvm (Failed)
40 - ts_format-rxvm (Failed)
41 - ts_format-rxbvm (Failed)
44 - ts_left-rxvm (Failed)
45 - ts_left-rxbvm (Failed)
58 - ts_right-rxvm (Failed)
59 - ts_right-rxbvm (Failed)
72 - ts_translate-rxvm (Failed)
73 - ts_translate-rxbvm (Failed)
92 - ts_x2c-rxvm (Failed)
93 - ts_x2c-rxbvm (Failed)
94 - ts_x2d-rxvm (Failed)
95 - ts_x2d-rxbvm (Failed)
125 - arrays_test (Failed)
... even more than last time, when I had a mail in draft that did not make it out (and after the next commit they were normal again).
Reason I did not send it was that I also wanted to check Linux - and got sidetracked more than once. So I will check that after sending this one.
best regards,
René.
… On 28 Jul 2025, at 09:23, Peter-Jacob ***@***.***> wrote:
After optimising the SUBSTR and STRIP functions, I ran a performance comparison between the current version and one from early June. The updates were made over the past four weeks and include faster UTF-8 string handling as well as improved support for various types of whitespace beyond simple spaces.
⏱️ Performance Comparison
Operation Old Elapsed Time New Elapsed Time
SUBSTR(..., 1, 45) 2.038 s 0.496 s
SUBSTR(..., 19, 5) 0.720 s 0.507 s
SUBSTR(..., 52, 5) 0.716 s 0.544 s
SUBSTR(..., 9, 60) 2.566 s 0.939 s
STRIP(..., B) (both ends) 11.501 s 1.896 s
STRIP(..., L) (left only) 6.659 s 1.445 s
STRIP(..., T) (right only) 6.443 s 0.712 s
Total 30.643 s 6.539 s
⚡ Performance improved ~4.7× overall.
STRIP operations saw the largest gains. Although the performance has improved significantly, I was still surprised by how expensive the STRIP operation remains.
—
Reply to this email directly, view it on GitHub <#470>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC3WJQOZNEPIYLY3FXFL2AD3KXFVTAVCNFSM6AAAAACCQBXCUKVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZYGY2DINZXGA>.
You are receiving this because you are subscribed to this thread.
|
1 reply
|
yes, also Linux (and all the same testcases)
… On 28 Jul 2025, at 11:33, Peter-Jacob ***@***.***> wrote:
sorry to hear, I will have a look!
—
Reply to this email directly, view it on GitHub <#470 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC3WJQJ42XES62ZRCIOFTT33KXU7JAVCNFSM6AAAAACCQBXCUKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOJQHAYTMMA>.
You are receiving this because you commented.
|
1 reply
|
Hi Peter,
really no apologies required. Great that they are fixed. So - I thought we also had these tests clean at one moment?
best regards,
René.
… On 28 Jul 2025, at 14:09, Peter-Jacob ***@***.***> wrote:
My apologies — I didn’t fully think some changes through to the end. All errors have now been corrected, except:
18 – ts_c2x-rxvm (Failed)
92 – ts_x2c-rxvm (Failed).
A decision is still needed on how to handle these.
—
Reply to this email directly, view it on GitHub <#470 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC3WJQKQJXGDSCEVQUTVSCL3KYHJHAVCNFSM6AAAAACCQBXCUKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOJQHE3DMMY>.
You are receiving this because you commented.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
After optimising the SUBSTR, STRIP, POS, and LASTPOS functions over the past few weeks, I ran a performance comparison between the current version and a build from early June. The updates focused on faster UTF-8 string handling and expanded support for various types of whitespace beyond simple spaces. Given their frequent use in REXX, SUBSTR and POS are among the most performance-critical functions in the language. The measurements were taken by running each function one million times to ensure consistent and meaningful results.
⏱️ Performance Comparison
SUBSTR(..., 1, 45)SUBSTR(..., 19, 5)SUBSTR(..., 52, 5)SUBSTR(..., 9, 60)STRIP(..., B)(both ends)STRIP(..., L)(left only)STRIP(..., T)(right only)POS("only", ..., 1)POS("about", ..., 1)POS("about", ..., 70)LASTPOS("only", ..., -1)LASTPOS("tomorrow", ..., -1)All reactions