Jude Melton-Houghton

Results 137 comments of Jude Melton-Houghton

Should I add a setting to disable this, in case people want to save memory? At the most, it could use on the order of one megabyte per thread. Might...

By the way, I described a workaround here: https://github.com/minetest/minetest/issues/12167#issuecomment-1190415597

I suppose that a C++ method `get_raw_string` could be added which would be the same as `get_string` except it would pass `UINT_MAX` as the `recursion` parameter to `getString`. But this...

Is `get_node_name` different from `get_name_from_content_id` ? Maybe you could change `get_name_from_content_id` to cache its results, then use it in `get_node`. This would have wider reaching performance benefits.

One thing to consider is that `get_name_from_content_id` specifically can be called when mods are loading and nodes may yet be registered or unregistered. It should only cache nodes after all...

Potential implementation: ```lua local old_get_content_id = core.get_content_id local old_get_name_from_content_id = core.get_name_from_content_id local name2content = setmetatable({}, { __index = function(self, name) return old_get_content_id(name) end, }) local content2name = setmetatable({}, { __index...

@paradust7 Thanks for pointing that out, I added caching for async threads in my PR.

Besides putting stuff from `core` into local variables, you could restore the direct mappings between names and IDs. `get_content_id` would become a single hash lookup, while `get_name_from_content_id` would become a...

I recommend an approach similar to mine in #12444. This would entail keeping the C++ implementations of `get_content_id` and `get_name_from_content_id`, but they would not be called in the fast path.

Should `VoxelManip:get_node_at` be moved to Lua as well, caching will become significant on async threads.