3 Memory use optimisations for Lua mapgens

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

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.
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
BuckarooBanzay
Member
Posts: 437
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

¯\_(ツ)_/¯ Not active here anymore, contact me on the minetest discord, irc, lemmy or github (for programming issues)

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

sfan5
Moderator
Posts: 4095
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: No registered users and 7 guests