4 ms·
good stuff. tbh though, only ~3x slowdown in scripting imo is pretty damn good 8)
by CorvusCrypto 10y ago
good stuff. tbh though, only ~3x slowdown in scripting imo is pretty damn good 8)
- deleted 10y ago[deleted]
- nicky0 10y agohowever for comparison, presented without comment: python version 0.708s
- CorvusCrypto 10y agobtw was this after compiled to pyc?
- nicky0 10y agoNot sure, I'm not seeing a .pyc file in the directory. Same every time I run it though.
- lobster_johnson 10y agoIsn't the "scripting" part just automatically compiling behind the scenes before running? It's not an interpreter or a VM. So the code runs just as fast as the compiled version, it's just that you pay a startup cost.
- tarentel 10y agoThat's true between a debug build and just running it as a script I believe. But a release version will be optimized, I imagine if they compared a debug build to the scripted version they'd perform similarly.
- nicky0 10y agoCan confirm, Debug build runs in similar time to script.
- Someone 10y agoDifference is that Release builds do whole-module optimization in Swift 3. That allows for more aggressive code specialization and inlining and can remove more reference count updates (https://swift.org/blog/whole-module-optimizations/ https://swift.org/blog/whole-module-optimizations/)