3 Memory use optimisations for Lua mapgens

Festus1965
Member
Posts: 1398
Joined: Sun Jan 03, 2016 11:58
In-game: bye bye

Re: 3 Memory use optimisations for Lua mapgens

by Festus1965 » Post

I am very sorry,
i struggle with the OOM crash actually read the solutions but dont get sure about before and after!

like the example from here
is it before (i found) Source technic_worldgen/oregen.lua:
changed again and now this 2 lines like shown ... miss understand first, but wondering why "data" instead of "sulfur_buf"
got now better understand and changed, not tested yet.
Minetest has no future

User avatar
BuckarooBanzay
Member
Posts: 388
Joined: Tue Apr 24, 2018 05:58
GitHub: BuckarooBanzay
IRC: BuckarooBanzai
In-game: BuckarooBanzai

Re: 3 Memory use optimisations for Lua mapgens

by BuckarooBanzay » Post


Kurtzmusch
Member
Posts: 41
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

Re: 3 Memory use optimisations for Lua mapgens

by Kurtzmusch » Post

what happens when you try to recycle the buffers but the engine is set to generate maps with more than 1 emerge threads? should i make a buffer per thread or will the c++ threads take turns in calling my on_generated? sofar once said that lua is single-threaded, but isnt it possible for the engine to spawn 2 lua instances? if the threads do take turns to call on_generated doesnt this mean that a lua mapgen will be 2 to 4 times slower?( considering that most processors are duo or quad core)
Like Puzzles? Escape The Dungeon

User avatar
sfan5
Moderator
Posts: 3935
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: 3 Memory use optimisations for Lua mapgens

by sfan5 » Post

Kurtzmusch wrote:what happens when you try to recycle the buffers but the engine is set to generate maps with more than 1 emerge threads? [...]
Nothing, your Lua code does not have to concern itself with this.
Kurtzmusch wrote:if the threads do take turns to call on_generated doesnt this mean that a lua mapgen will be 2 to 4 times slower?( considering that most processors are duo or quad core)
That's a weird way to put it, but it's technically true since Lua is single-threaded.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

Post Reply

Who is online

Users browsing this forum: hoodedice and 1 guest