Hello
This is one of the new features provided by Ring 1.25 (under development)
The Ring Object File (*.ringo) format is revised to Reduce storage and Increase performance by over 40%
For example, For PWCT2 project
(1) pwct.ringo size is reduced from 21MB to 12MB
Note: You can compress this file to around 2MB file as zip file
(2) loading time
At first prepare the object file using specific Ring version
ring pwct.ring -go -norun
Then test the loading performance
Test: (ring pwct.ringo -norun -clock)
Using Ring 1.24: 565 ms
Using Ring 1.25: 315 ms
Things to remember about the Ring Object File (*.ringo)
(1) It's portable, the same ringo file could be loaded using Ring for Windows/Linux/macOS/etc.
i.e. compile once, run everywhere
(2) Using Ring State (Embedded Ring in Ring) you can load a Ringo file during runtime, for example (a Ringo file for Softanza Library) then execute some code. This is faster than compiling stzlib, also, using such a way it will be more easier to distribute StzLib updates (just distribute one file)
Example:
pState = ring_state_new()
ring_state_mainfile(pstate,"stzlib.ringo")
ring_state_runcode(pstate,"? 'We can call functions from Ring Object File!' ")
ring_state_runcode(pState,`
oOrg = new stzOrgChart("Basic_Hierarchy")
oOrg {
SetLayout("TD")
# Add executive position
AddExecutivePositionXT(:ceo, "CEO") # ceo is the ID of the node and CEO it's label
# Add management positions
AddManagementPositionXT(:vp_sales, "VP Sales")
AddManagementPositionXT(:vp_eng, "VP Engineering")
# Set reporting lines
ReportsTo(:vp_sales, :ceo)
ReportsTo(:vp_eng, :ceo)
# Add staff positions with attributes
AddStaffPositionXTT(:sales_rep1, "Sales Rep 1", [:region = "North"])
AddStaffPositionXTT(:dev1, "Developer 1", [:skill = "Backend"])
ReportsTo(:sales_rep1, :vp_sales)
ReportsTo(:dev1, :vp_eng)
View()
}
`)
ring_state_delete(pState)
? :done
Such a code could we wrapped in one class or function that call StzLib
This requires stzlib.ringo file to be in the app folder
Think of *.ringo files as DLL/So/Dylib files but contains Ring byte code
Such a way to test StzLib samples is at least 2x faster (loading time) than using (load "stzlib.ring")
Greetings,
Mahmoud