I wanted to do some background loading in my game. My idea was to detach the childs and do the calculations like the code below. But this was 10 times slower than just doing the calculations in the main thread because the remove_child and add_child took so long. Did I do something wrong with the code? Please be aware that the syntax maybe is wrong because this is just pseudocode as I'm usually programming in C# but I think this is the correct code for GdScript.
for i in range(0, 3):
remove_child(childs[i])\
//...
// do calculations on child nodes in another thread
// check if the thread is done and re-add childs if it is or do something else if not.
for i in range(0, 3):
add_child(childs[i])