Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instancing 3d nodes off the main thread (in repl) is slow #14

Open
selfsame opened this issue Jan 3, 2021 · 4 comments
Open

instancing 3d nodes off the main thread (in repl) is slow #14

selfsame opened this issue Jan 3, 2021 · 4 comments

Comments

@selfsame
Copy link
Collaborator

selfsame commented Jan 3, 2021

looks like this will get fixed with the vulcan renderer: godotengine/godot#36793

Alternately, we could consume REPL forms in the main thread.

@selfsame
Copy link
Collaborator Author

selfsame commented Jan 4, 2021

fixed with 5b46bc4

I'm happy with this hack,: using arcadia.core/timeout for tooling evals/loadfile to get into the main thread

@selfsame
Copy link
Collaborator Author

selfsame commented Jul 1, 2021

Re-opening this since the NRepl main-thead-eval wasn't working (see #20)

@selfsame selfsame reopened this Jul 1, 2021
@kdlee
Copy link

kdlee commented Nov 26, 2021

To me seems like it's not just slow, but calling instance() from a thread also appears to have stability issues.
Using Godot 3.3, I'm getting crashes from places like below, even with RENDER_SEPARATE_THREAD mode set in the project.
Seems like calling instance() from a thread maybe isn't fully fleshed out yet ...

StringName::operator<(const StringName & p_name) Line 100 (godot\core\string_name.h:100)
Comparator::operator()(const StringName & p_a, const StringName & p_b) Line 292 (godot\core\typedefs.h:292)
Map<StringName,StringName,Comparator,DefaultAllocator>::_find(const StringName & p_key) Line 241 (godot\core\map.h:241)
Map<StringName,StringName,Comparator,DefaultAllocator>::find(const StringName & p_key) Line 533 (godot\core\map.h:533)
Shader::remap_param(const StringName & p_param) Line 92 (godot\scene\resources\shader.h:92)
ShaderMaterial::_get(const StringName & p_name, Variant & r_ret) Line 141 (godot\scene\resources\material.cpp:141)
ShaderMaterial::_getv(const StringName & p_name, Variant & r_ret) Line 78 (godot\scene\resources\material.h:78)
Object::get(const StringName & p_name, bool * r_valid) Line 516 (godot\core\object.cpp:516)
Resource::duplicate_for_local_scene(Node * p_for_scene, Map<Ref,Ref,Comparator<Ref>,DefaultAllocator> & remap_cache) Line 167 (godot\core\resource.cpp:167)
SceneState::instance(SceneState::GenEditState p_edit_state) Line 246 (godot\scene\resources\packed_scene.cpp:246)
PackedScene::instance(PackedScene::GenEditState p_edit_state) Line 1706 (godot\scene\resources\packed_scene.cpp:1706)

@selfsame
Copy link
Collaborator Author

selfsame commented Dec 2, 2021

@kdlee ah yeah that's unfortunate,

I've heard that instancing in threads will be better supported in Godot 4, but in the mean time if you use the UDP or Socket Repls they will eval on the main thread (https://github.com/arcadia-unity/ArcadiaGodot/blob/master/Source/arcadia/repl.clj#L256)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants