Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Gideros 2025.2 — Gideros Forum

Gideros 2025.2

hgy29hgy29 Maintainer
Dear Giderians,

I've been working on a Gideros project (and still do) that involved showing and computing millions of elements, and began to hit the limits of what luau can do. Of course writing a native plugin was an option, but I wanted to get the most out of luau before resorting to writing a plugin, and discovered various ways to improvement luau performance.
This new release of Gideros integrates those changes, which are:

- buffers
Since Gideros 2025.1 luau benefits from a native buffer type, which can hold raw binary data. If you used to handle raw data in strings, buffers can provide significant boost. See full original buffer API here: https://luau.org/library#buffer-library
But while this API is nice already, I thought it would be great if buffers could be used just like arrays, so I added a buffer.setarrayaccess(buffer,dataType,dim2,dim3) call for that. It makes accessing buffer values as an array both easier and faster.
dataType can be u8,s8,u16,s16,u32,s32,f32 and f64 (for unsigned int/signed int/float types with their bit size).
width and height allow index a buffer with a vector. In that case the buffer index becomes z*dim3+y*dim2+x.
Buffers are not just fast, they also consume less memory. In luau, every value is 16 bytes long, whatever it is. If you just need an array of bytes, using a buffer instead of a table saves 16x the memory.
A few Gideros calls have been updated to accept buffers as input, since it is also more efficient to use buffer data directly than to grab each array value individually.
Specifically, you can now construct textures from buffers and even provide raw texture data, not necessarily RGBA.

- luau fast paths
Luau VM has had many optimizations regarding frequently used functions calls (math,pairs,ipairs,etc) for a long time, but they are only enabled if luau can be sure those functions are what they ought to be, that is they can't be redefined by lua code.
In Gideros you can always redefine functions, although it is unlikely one will ever want to redefine those I mentionned. This mean that these optimizations weren't enabled.
This new Gideros introduces a new global function setsafeenv(flags), which tells luau the global envrionement is "safe" and so enbales optimizations. flags parameter indicates which optimizations to enable, and you'll probably want them all by using -1 value.

- raw iterator
lua next() and pairs() calls works on keys, which means that luau have to lookup the previous key to find the next one on each iteration. Enabling optimizations with the above call enables a fast path for 'for' loops with a 'pairs' call, but nothing is done if you use them outside a 'for' loop.
But luau 'C' API had a lua_rawiter() call which allowed to keep an internal index during key/value pairs iterations, so I made it available to lua code.

With Gideros 2025.2, your apps will run faster!

Full change log:
New features
[luau] Add key,value,nextindex=rawiter(table,index) function
[luau/buffer] Added buffer.resize(buffer, newSize, dataOffset)
[luau/buffer] Added buffer.extract(buffer, offset, size)
[core] Add Core.setAutoYield() to change auto yield capability of async tasks
[gfx/path] Add a getPathOffset() call to get the distance of a point in the path from the beginning

Improvements
[luau] Improve table clone
[luau] Enable fast-path optimizations for pairs/fastcalls through setsafeenv(flags)
[gfx/texture] Support creating and updating from luau buffers
[gfx/texture] Allow uploading raw textures from buffers
[examples] update Tiled demo Sewers

Fixes
[qt/mac] Fix plugin path
[gfx/particles] Fix multi texture rendering
[backend/gl2] Fix vertex divisor setting
[gfx/mesh] Fix and improve setGenericArray() when using buffers
[gfx/mesh] Check indices values
[core/threads] Provision for checking if threads should be stopped
[pixel] Remove static VBO after last use
[qt/screen] Change code to be more in line with what should have been done

Download it from here:
http://giderosmobile.com/download

Likes: pie, MoKaLux, keszegh

Tagged:
+1 -1 (+3 / -0 )Share on Facebook

Comments

Sign In or Register to comment.