1 Answer. The code runs slow because it is a heap of unstructured code (this is the cleaned up version) that is constantly loading external resources, reading events and mouse data. Structure your code so that slow things like reading from files happen ONCE. not once for each block.