godot-addons/godot-behavior-tree-plugin

Slow execution due to print statements

JAStrachan opened this issue · 0 comments

As it says in the title, when using the plugin I was getting pretty bad lag. The print statements saying "opening node" and "closing node" were slowing the whole thing down. I only discovered this after a lot investigation as it didn't occur to me it could be them. After removal speed was not an issue.

My question is do we even need those print statements? Are they useful? They might confuse new godot developers who might not realise why the plugin is running slow.

It's in the script bt_base from line 28

func _open(tick):
	print("opening node")
	tick.openNode(self)
	tick.blackboard.set('isOpen', true, tick.tree, self)
	open(tick)

func _close(tick):
	print("closing node")
	tick.closeNode(self)
	tick.blackboard.set('isOpen', false, tick.tree, self)
	close(tick)