[sys.settrace](https://docs.python.org/3/library/sys.html#sys.settrace) could be a very useful tool for performance analysis via python rather than requiring a lot from the VM/C itself. There is a PR to micropython for it here: https://github.com/micropython/micropython/pull/4265 from @malinah