Hacker News new | ask | show | jobs
by Avery3R 1273 days ago
But you're still getting the perf hit of calling a function and checking if the module is already loaded
2 comments

It’s a fairly simple dict lookup. The same lookup would happen when you use something from that module, so it’s fairly insignificant in the grand scheme.

Besides, it’s Python. It’s not going to be super fast anyway. That extra check is never going to show up on a perf trace.

Yeah well there's never been a line of Python that's free