In addition to what Tom said, here’s a few specific things to consider that may speed up your GHPython components:
This might also help with wrapping your head around how Python is implemented in Rhino: