Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Can you see any side-effect/drawback in merging lua files in project? — Gideros Forum

Can you see any side-effect/drawback in merging lua files in project?

piepie Member
edited August 2015 in General questions
Hi, maybe this question is for the core-team, but I am open to any suggestion or experience:

my game is composed of many lua files (approx 50).
This means that loading all of these require at least 50 file open/read/close iterations at app start. Am I right?

I was wondering: if I merge all these files in one single file ( main.lua) respecting the call order, should be possible to improve loading time? (Either if it's bigger it would be only one file to open/load/close, plus the other "not mergeable" files like png, json...).

Can you think of any side effect doing this? Is this a wild guess and you already know a reason why there would be no better performance? :)

I'd like to make a test and write an app to merge files. It should read from a gideros project file, and export a "merged gideros project" with the same folder structure, but only one lua file to load:

do you have any suggestion on how to preserve dependencies/call order if I read the gideros project file to use it as a list of the files to merge together?


thank you

Comments

  • john26john26 Maintainer
    When you export your project for any OS there is a file called luafiles.txt which contains all your Lua files in the correct order. In fact the various players read this file and open the Lua files in that order before the game starts. So your program could read this file and concatenate all the files in this order.

    Personally I doubt it would make much difference to performance but it's worth trying. The one where it might help is Android since this has no native file system (if I understand it) and files have to be extracted from the APK.

    Likes: pie

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.