In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you the choice of PHP framework and several mainstream framework performance of the basic evaluation of the example analysis, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!
Demand
There is no doubt that Web framework technology has been developed and popularized by leaps and bounds in recent years. In the past few years, the popularity of framework technology has experienced a great process of improvement, a large part of which can be attributed to RubyonRails and the idea of MVC framework revealed in other programming languages.
If you are a PHP ninja rather than a die-hard Ruby follower, you may be surprised that there are so many frameworks on the market, which one is right for you. Of course, answers and questions depend on many factors, and today we will review this typical question of how to choose the right PHP framework for your next application.
At the same time, let's take a look at the popular PHP framework and compare their differences, which can help you make a wise choice and find the framework that best suits your project.
Identify your needs
Before you decide to choose a framework for your project, you should understand the needs, requirements, and some of the work of the development team behind the scenes. We have summed up the following questions that you can try to ask yourself before moving on to the next step.
What problems does your application focus on solving?
Your application can be an e-commerce platform, a social networking site, a message sharing platform, or an active directory, for example, if you are building an e-commerce site, you may prefer to choose frameworks with mature extension libraries for handling credit card and transaction sessions. On the other hand, if it is a lightweight messaging platform (such as Weibo systems), you should probably pay more attention to rapid expansion and cross-server cross-data support access, in order to achieve load balancing and fast connection access.
What will be your mainframe operating environment?
Some special frameworks will need to use some other non-default PHP extensions or software installed on the server, for example, some frameworks' data abstraction layer must require access through PDO, rather than directly calling the lower-level MySQL or MySQLi, or some programs like wiki often need to use external programs such as ImageMagick or Graphiviz for image compression and processing functions. These extensions may not be supported by all shared host environments (virtual hosts). In addition, even if it is a lightweight framework that integrates all the required function libraries and has good portability and adaptability, the performance of such a framework will become its main bottleneck when dealing with data-intensive operations or large-scale data processing systems.
What are the strengths and weaknesses of your developer or team?
If you are a project manager, it is important to understand the abilities and weaknesses of your specific developers, because they are really boring workers. so maybe you can choose some framework that is more developer-friendly and easy to use. Of course, this issue may not be the decisive factor in deciding whether to adopt a framework (it is always good to constantly ask yourself and the team to learn new technologies). But it is definitely an important consideration that will affect your schedule, budget, security and other factors.
How to choose between a "high coupling" or a "low coupling" framework?
According to the coupling of frame products, the mainstream php framework products are divided into two categories: high coupling and low coupling. The low-coupling framework looks more like a rich function library and logical encapsulation abstraction layer, and even some good frameworks themselves are an advanced extension component of PHP, such as PDO, which is definitely a data access framework and abstraction layer. There are other low-coupling frameworks worth mentioning, such as ZendFramework,CakePHP, and the domestically developed ThinkPHP fall into this category. If you will take over a lot of project history problems and have a high customization of UI, you may need a low-coupling framework to meet your flexible needs.
On the other hand, there are some representatives of high-coupling frameworks, such as some frameworks derived from CRM similar to Drupal,Joomla, and OpenbizCubi frameworks developed directly for high coupling, domestic small-scale popular frameworks and Puyuan, etc. The best feature of these frameworks is that they allow you to focus entirely on implementing your core business logic. You don't even have to worry about how to implement basic features such as UI and user session management, you just need to "connect" your code to the interface specifications they provide. If you are working on a new project, you certainly don't want to spend most of your time implementing basic business logic, such as developing a "parking lot management system" for your client company, or choosing a framework like OpenbizCubi, on which to implement your business logic directly is the best match for your time budget and return on investment.
Simple performance evaluation
Case
This test output simple hello word, simple MVC logic, (Router-> Controller-> Viewer), no database connection, no logic.
Hardware platform
CPU: Intel Core i5 750 (2.67GHz x4)
RAM: 4GB
Software environment
Debian 6.0.4 x8634 (2.6.32-41)
Apache 2.2.16 (mpm-prefork,mod-php5)
Php 5.3.10
Php-apc 3.1.9 (Optimization for include/require)
Copy all projects to / dev/shm/* (Optimization for files read/write)
List of PHP frames
* zf: Zend Framework
Site: http://framework.zend.com
Ver: 1.11.11
* zf2: Zend Framework
Site: http://framework.zend.com
Site: https://github.com/zendframework/ZendSkeletonApplication
Ver: 2.0.0-beta1
* symfony: symfony
Site: http://www.symfony-project.org
Ver: 2.0.0
* cakephp: CakePHP
Site: http://cakephp.org
Ver: 2.0.4
* ci: CodeIgniter
Site: http://codeigniter.com
Ver: 2.1.0
* yii: Yii Framework
Site: http://www.yiiframework.com
Ver: 1.1.8
* micromvc4: MicroMVC
Site: http://www.micromvc.com
Ver: 4.0.0
* laravel: Laravel, A PHP Framework For Web Artisans
Site: http://laravel.com
Ver: 2.0.2
* slim: Slim Framework
Site: http://www.slimframework.com
Ver: 1.5.0
* yaf: Yet Another Framework in PHP Extension
Site: http://code.google.com/p/yafphp
Ver: 2.1.3-beta (yaf.cache_config=1)
* FuelPHP: Simple, Flexible, Community driven Web Framework
Site: http://fuelphp.com/
Ver: 1.1
* ColaPHP:
Site: http://code.google.com/p/colaphp/
Ver: 1.2-ga
# XHProf: A Hierarchical Profiler for PHP
Site: http://pecl.php.net/xhprof
Ver: 0.9.2
# The source code of this testing:
Source: https://github.com/eryx/php-framework-benchmark
1. Apache Benchmark
Requests pre second (- c 100-n 30000), the bigger is better
Request / second (- c 50000-n 200). The higher the number, the better.
two。 System load
Load diagram completed in one minute of stress test
The smaller the better (- c 30000-n 100)
3. Memory utilization
Test the memory consumed by hello word, the smaller the better.
4. Response time
The response time of the page. The unit is subtle.
5. Number of methods called (Facebook XHProf)
How many methods are called in a single hello word page, and how many methods are zend5620? is it too bloated?
6. Number of Fil
The number of included or required in files used to open hellow word. The smaller the better, there are a lot of zend, yii19, yaf only 4, no wonder not happy.
These are all the contents of this article entitled "sample Analysis of PHP Framework selection and basic performance Evaluation of several mainstream frameworks". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.