procedural code, vs oopy code and performance
I've written a backend app for use with a iOS App. When I started开发者_开发问答 the project, I didnt know OOP at all.
Now half the scripts are classes and I am using a mvc pattern and classes. It sure is easier to reuse my methods now, but now there is alot more going on with each request.
For a backend system that handles pre fabricated (Predictable) requests, is it better "performance-wise" to use basic procedural scripts or use mvc and oop?
I ask as it seems as though much more happens when using mvc and oop.
A hand-crafted solution written in assembly language for the target CPU by expert programmers will perform best in general, but cost 100 times more. Your solution, while it may perform a little less than a procedural program will be far more maintainable over time, allowing you to a) do something else and b) buy faster hardware. Since these are pre-fab queries, add a caching layer such as memcached.
精彩评论