Performance regression

21 views
Skip to first unread message

Mansour Ayouni

unread,
Jan 16, 2026, 5:27:52 AMJan 16
to The Ring Programming Language
Hello Mahmoud,

I hope you are enjoying your vacancy...
When returned, can you please check the accuracy for this #TODO I have in Softanza codebase about a regression performance between Ring 1.22 and Ring 1.24:

image.png

This function just loops over the list and checks for non numbers:

func IsListOfNumbers(paList)
    if NOT isList(paList)
        return 0
    ok
    nLen = len(paList)
    for i = 1 to nLen
        if not isNumber(paList[i])
            return 0
        ok
    next
return 1

The same issue is observed on Ring 1.25.

All the best,
Mansour

Mahmoud Fayed

unread,
Jan 16, 2026, 5:47:42 AMJan 16
to The Ring Programming Language
Hello Mansour

I don't see this issue; I tried the program using Ring 1.25
It's done in 14 milliseconds (i.e. 14ms)

decimals(3)
t1= clock()
? IsListOfNumbers(1:100_000)
t2= clock()
? (t2-t1)/clockspersecond()


func IsListOfNumbers(paList)
    if NOT isList(paList)
        return 0
    ok
    nLen = len(paList)
    for i = 1 to nLen
        if not isNumber(paList[i])
            return 0
        ok
    next
return 1

Output:
1
0.014

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Jan 16, 2026, 5:51:54 AMJan 16
to The Ring Programming Language
Hello Mansour

Also, using Ring for WebAssembly, it's still fast (done in 16ms)

listper.png

Greetings,
Mahmoud

On Friday, January 16, 2026 at 1:27:52 PM UTC+3 kalid...@gmail.com wrote:

Mansour Ayouni

unread,
Jan 16, 2026, 6:04:36 AMJan 16
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

You are right! The issue is related to internal staff in Softanza that I'm searching for...
I'll keep you informed...

THANKS A LOT!
Best,
Mansour

--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/81fd1448-01a4-4862-be32-094494e13bacn%40googlegroups.com.

Mahmoud Fayed

unread,
Jan 16, 2026, 6:15:23 AMJan 16
to The Ring Programming Language
Hello Mansour

You are welcome :D

Greetings,
Mahmoud

Mansour Ayouni

unread,
Jan 16, 2026, 6:16:08 AMJan 16
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

The problem is so strange...

When I write the code in a fresh new Ring file, no issue. I takes 0.018s on my machine.
When I just load stzlib, the issue is observed: 10.910 seconds!
But when I profile stz loading time it's just 0.6 seconds...

image.png

All the best,
Mansour

Mansour Ayouni

unread,
Jan 16, 2026, 6:17:18 AMJan 16
to Mahmoud Fayed, The Ring Programming Language
Note how I used a different name for _IsListOfNumbers()_ to avoid any call to anything from Softanza, it's just Ring code...

Mahmoud Fayed

unread,
Jan 16, 2026, 6:47:17 AMJan 16
to The Ring Programming Language
Hello Mansour

>> "When I just load stzlib, the issue is observed: 10.910 seconds!"

This happens because the Range Operator create the list by allocating for each item one by one
This is fast when we have enough items in the memory pool
Loading StzLib consumes most of these items in the memory pool 

To have better performance, use the List() function

Example:

load "stzlibconfig.ring"
load "stzlib.ring"

decimals(3)
t1= clock()
mylist = list(100_000)  // Allocate memory block for all items instead of using the memory pool 
for t=1 to 100_000 mylist[t] = t next
? myIsListOfNumbers(mylist)
t2= clock()
? (t2-t1)/clockspersecond()

func myIsListOfNumbers(paList)

    if NOT isList(paList)
        return 0
    ok
    nLen = len(paList)
    for i = 1 to nLen
        if not isNumber(paList[i])
            return 0
        ok
    next
return 1

Output:

1
0.025

Greetings,
Mahmoud

Mansour Ayouni

unread,
Jan 16, 2026, 6:53:16 AMJan 16
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,
It's solved!!! Very noice to know this feature...
Thank you very much!
Best,
Mansour

Mahmoud Fayed

unread,
Jan 16, 2026, 7:01:45 AMJan 16
to The Ring Programming Language
Hello Mansour

You are welcome :D

Greetings,
Mahmoud

Mansour Ayouni

unread,
Jan 16, 2026, 7:10:45 AMJan 16
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Using Ring 1.25 daily, while working on the Graph Module of StzLib, which contains networked manipulations of nodes and their relations, I observed a general performance enhancement up to 30% compared to Ring 1.24.

I never had any bugs or regression until now.

Best,
Mansour

Mansour Ayouni

unread,
Jan 16, 2026, 7:33:36 AMJan 16
to Mahmoud Fayed, The Ring Programming Language

For example, this code instantiates a stzDiagram object, which is itself a child of stzGraph, then calls stzGraphRules for applying visual rules on the nodes (a different color for each price range), and then fires the Graphiz DOT engine to generate the  DOT diagram image.

Ring 1.25 made it in half a second compared to Ring 1.24 which does it in 0.70 (s).

image.png

Which is very encouraging.

All the best,
Mansour
Reply all
Reply to author
Forward
0 new messages