4 ms·
Why I said is that I would go directly to pypy and related, without first trying to optimize like they did in Python world. They guys at Magnetic came to same c
by elyase 11y ago
Why I said is that I would go directly to pypy and related, without first trying to optimize like they did in Python world. They guys at Magnetic came to same conclusion in the end: "Curiously, the function implementation is actually slower than the class approach in PyPy." I don't find this surprising anymore because it is what almost always happens in my code.
- jerf 11y agoAh! That makes sense. Thank you.
- gknoy 11y agoI think the techniques discussed here have value, pedagogical and otherwise. Perhaps one is working on a codebase where we don't have the luxury to move to pypy or similar (e.g., my current one which uses some incompatible libraries, so transition would be nontrivial). The fact that that method accessors are much slower than properties, or that closures can speed things up, is something that we might not always be mindful of, and that new python programmers might not think through.