Performance improvements in Ring 1.19 (Under Development)

91 views
Skip to first unread message

Mahmoud Fayed

unread,
Nov 15, 2023, 11:14:45 AM11/15/23
to The Ring Programming Language
Hello

Ring as a language is designed for freedom (Any Syntax/Paradigm/Platform), productivity (Developing DSLs in short time, small number of data types, Tools, many libraries, etc.) and being lightweight (Small implementation with respect to Compiler/VM C code) and using a memory management model that's more predictable.

But I know from long time ago that we need to improve Ring performance, and this would help in using the language in more tasks. I delayed investing long time in performance improvements to be sure that we have a stable product in the first place, while using the language in my projects and getting real experience that guide the development. PWCT2 is an example about a project developed using Ring and helped me to direct its design.

Now since I am happy with Ring as a language, it's the time to go and invest more time in Libraries, Tools & Improving performance. The next release of Ring is a step in this direction and comes with the next performance improvements.

(1) For loops is three times (3x) faster - This is enough to finish a loop from 1 to 100,000,000 in 1 second on my machine.
(2) Calling Ring functions is two times (2x) faster
(3) Calling C functions (Ring extensions) is three times (3x) faster
(4) Calling Methods using the dot operator is (2x) faster
(5) Calling Methods using braces is (3x) faster
(6) Reducing memory used by Ring Items/Item structures 

As a result of these improvements, The Game/Graphics examples that are based on calling C functions are (2x to 3x) faster.

For example, The stars3.ring example works at 2000FPS instead of 500FP
The Levels of cubes example, works at 200FPS instead of 64FPS
The Level of cubes example that uses RayLib works at 3000 FPS instead of 1000FPS

I fell the speed in most examples/applications.

These updates are inspired by the work of Illir Liburn on Ring2A and Ring2B projects.

More performance improvements will come in each new release of Ring 

Also, supporting real arrays (instead of lists) as suggested by Bert Mariani is on my to-do list. I have many ways to do this, I am just spending more time to match the feature with the language spirit and original design (And good ideas are coming).

Thanks to the team, and everyone who is using Ring and trust the development process.

Greetings,
Mahmoud
 

Mansour Ayouni

unread,
Nov 15, 2023, 11:45:01 AM11/15/23
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

I'm proud and happy of this development. You are leading the language with pragmatism and a spirit of achievement.

I trust your plans. That's why the performance objective of my SoftanzaLib project has been considered important, but not a top priority since I know this battle will be opened one day at a time.

I'll be happy to test the new language enhancements against the library and let you know.

Many thanks to Ilir for his commitment and perseverance in his low level Ring projects, and to Bert for raising the C-like array case, and everyone who uses the language and believes in its billant future!

Sincerely,
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 on the web visit https://groups.google.com/d/msgid/ring-lang/1a88000d-bfff-4bb6-85cc-16a5e28eb240n%40googlegroups.com.

Ilir Liburn

unread,
Nov 15, 2023, 2:37:10 PM11/15/23
to The Ring Programming Language
Hello All,

>> These updates are inspired by the work of Illir Liburn on Ring2A and Ring2B projects.

Glad to contribute. Congratulations on the new achievements.

>> Many thanks to Ilir for his commitment and perseverance in his low level Ring projects

You're Welcome. I'm also working on the high level part where you can declare your functions and/or classes-methods by identifying local variables which boosts Ring VM performance. But main goal here is to ease Ring->C(++) conversion where it is important to know which parts are local/static while using the compiler. Besides Ring2C+ which is different internally, this is going to be merged to official Ring as well (released as Ring2C).

Greetings,
Ilir

Mansour Ayouni

unread,
Nov 15, 2023, 3:43:20 PM11/15/23
to Ilir Liburn, The Ring Programming Language
Hello Ilir Liburn,

I'm glad you made this clarification.

All the best,
Mansour

Bert Mariani

unread,
Nov 15, 2023, 5:39:09 PM11/15/23
to The Ring Programming Language
Hello Mahmoud, Ilir

Re: "  it's the time to go and invest more time in Libraries, Tools & Improving performance."

This is good news !!!
Increasing performance will increase the popularity and use of the Ring language.
Supporting real arrays will definitely increase the speed of many apps.

Mahmoud Fayed

unread,
Nov 15, 2023, 6:29:55 PM11/15/23
to The Ring Programming Language
Hello Bert

>> "Supporting real arrays will definitely increase the speed of many apps."

According to my early tests, The performance gain could be from 20% to 60% 
But the memory that will be saved, could be huge amount of memory.

Greetings,
Mahmoud
Reply all
Reply to author
Forward
0 new messages