3 ms·
> I've always assumed a lot of its slowness is due to being interpreted and the duck typing Being interpreted definitely, even though there are some rarely-use
by BerislavLopac 4y ago
> I've always assumed a lot of its slowness is due to being interpreted and the duck typing
Being interpreted definitely, even though there are some rarely-used methods that can improve that. Additionally, there are more than one implementations of Python, and pypy is much faster than the standard CPython.
As for duck typing, why would that make a language slower exactly?
- Sohcahtoa82 4y ago> As for duck typing, why would that make a language slower exactly? I assumed it would result in basically every operation to require multiple lookups to figure out how types would interact at runtime. Like a simple "foo.bar(biz + baz)" would have to check the types of biz and baz, figure out how to add them, then look up the foo object and make sure it has a function named baz, and then call it. I assumed all these lookups and verifications would add significant overhead.