5 ms·
Devil's advocate: relative to C (which vim is written in), Python 2 is considerably slower, especially with CPython as its interpreter. Optimization is also tou
by dbbolton 11y ago
Devil's advocate: relative to C (which vim is written in), Python 2 is considerably slower, especially with CPython as its interpreter. Optimization is also tougher.
Personally, I admit I'm not sure that the difference is significant for this particular project.
- Skunkleton 11y agoHonestly, python might perform better overall. Not because C is slower than python (ha), but because python probably outperforms vim script. Especially likely because vim plug-ins can be fairly complex.
- duaneb 11y agoThe actual operations on text buffers are going to be the hardest part to implement in python performantly.
- alexchamberlain 11y agoThey're the bits you could push down to C and/or use one of many jiting options.
- duaneb 11y agoSure. But at that point, why not just python script vim?
- shadowmint 11y agoRealistically this is like saying you could rewrite git in python and just push the hard bits down into C; the problem is that you end up writing a significant portion of both the core, and plugins, in C. When you're writing all of the main parts of the editor in C, at this point, why are you using python at all?
- alexchamberlain 11y agoI'm not necessarily defending the rewrite here, but writing something like git in Python, profiling then optimising the parts that are slow doesn't sound like a bad idea.