4 ms·
Rendering a GUI is much more overhead than the business logic to set up the GUI and make it interactive. A GUI is only "slow" if there is a user-triggered opera
by vortico 8y ago
Rendering a GUI is much more overhead than the business logic to set up the GUI and make it interactive.
A GUI is only "slow" if there is a user-triggered operation that takes more than 10ms. Interpreting a Python callback is many orders of magnitude smaller than this, and complex algorithms can be outsourced to other languages if needed.
Focus on your bottlenecks first. Don't pre-optimize.
- agentultra 8y ago> Don't pre-optimize. Don't pessimistically de-optimize either. It's harder to remove bottlenecks from mature applications than it is to plan ahead for the target platform and common use cases. By all means, prototype in Python but if your target platform is, at minimum, a R-Pi 2 and you want the experience to be snappy even when their is high IO or CPU work being done... then don't release on Python; use the prototype to drive the implementation in C. Maybe consider even compiling from a higher-level language into a C library to minimize the boiler-plate. Planning goes a long way, even if you don't plan everything up front.
- vortico 8y ago>It's harder to remove bottlenecks from mature applications than it is to plan ahead for the target platform and common use cases. I disagree. It's easier to release first and change what you need later, since there might only be 1-10 sections of code that need to be changed. Python is extremely fast to write, maybe 3x faster than C. This means you can get seed funding and sales faster, and if the idea is good enough to get a decent salary, you can just hire out optimization for a v2 release. It also allows your application to appear to get better over time, which makes long-term customers happy.
- agentultra 8y agoFor a typical SV B2C web application, sure, but we're talking about developing applications for a low-power device. Knowing your target platform and your end goals can aid in planning. Planning your architecture ahead of time can save you from having to optimize later... and often optimizing later is harder than simply doing the easy, right thing first.
- vortico 8y ago"Low power" or "slow CPU" has nothing to do with it. When you have a bottleneck (GTK, X11/Wayland, video drivers) that is 100x more significant than the binding language (Python), switching languages will only buy you 1% speedup at best. I'm not saying to go forth unplanned. I'm saying that using C over Python in this case is a waste of time.
- ChrisRR 8y agoThis is not pre-optimisation. If you start writing your code using javascript, any development on top will continue to be javascript. Until you end up with a full project of javascript and you can't move to C because doing so would mean re-writing an entire project.