Table of Contents
In this study, an experiment is conducted in which five functionally equivalent web applications representing a simple blog are developed. The first Codeigniter web application is developed using plain PHP and the second one is developed using the CODEIGNITER framework and the last one is developed using the Laravel framework. let us start with some points about Comparison with Php along with Codeigniter and Laravel Framework.
In the experiments, execution time and the consumed memory usage when executing the CREATE, READ, UPDATE and DELETE (CRUD) implementation in each web application of the experiment will be measured. The memory usage and the execution time are measured in plain PHP by using the built-in functions in PHP scripts. The Codeigniter framework also has built-in functions for memory usage and execution time measurement and also codes are available for the laravel framework to measure the memory usage and execution time for the four functions.
Our research will answer the following basic question:
How do memory usage and execution time differ for a simple blog PHP web development in plain and the one developed with the Codeigniter framework?
The two web applications developed will be tested in terms of their execution time and memory usage. The two measurements have been done based on CRUD i.e. create, read, update, delete. These are the basic function of any web application.
Create action- The measurement starts in the create-blog-entry view when the user has pressed the create-blog-entry button after the form has been filled in. Once done, the newly created blog entry is presented in view-blog-entry view and the measurement is stopped.
View action- The measurement starts when the link responsible to show the blog entry is clicked and ends when the controller views the blog entry. This happens on the index page where only one blog entry is created. Once the view is rendered, the measurement is stopped.
Update action- The measurement starts when the updating input data is posted from the update-blog-entry view using a submission button. The measurement ends when the updated blog entry is shown in a view-blog-entry view.
Delete action- The measurement starts when the delete button in a view-blog-entry view is pressed and ends after the index page has been rendered completely with the information confirming that the deletion was successful.
RESULT AND ANALYSIS
The results from the conducted experiments are presented and analyzed. The presentation is outlined in a tabular form in which the horizontal columns represent the tested actions Create, Read, Update and Delete. For each tabular form, there is a corresponding visual presentation in a form of a graph.
Execution time experiment results- The results show that Codeigniter has more execution time during the create and update action but it takes less time during view and deletes action. Although plain PHP is only fast by a few milliseconds which will be almost ignored by the user. But we can see that LARAVEL performs well and has less execution time for all four actions. The results of the ten inputs as a mean for the four actions are presented below:
Memory Usage Experiment Result- The results of the memory usage experiment are such that Codeigniter uses a fixed memory for all the four actions of creating, reading, updating, and deleting, but the memory used by plain PHP blog varies every time for all the actions but laravel uses more memory in all the four functions. The values have been plotted in tabular form. The tabular form is also represented in visual form as a graph.
TABLE 2: Memory Usage experiment results table
To answer the research questions defined below:
(1) How do execution time and memory usage differ for a simple blog web application written in plain PHP and the Codeigniter framework?
(2) What will be more reliable for the web applications development?
It would initially be stated that the following text would be considered as an answer to both research questions. The reason for that is that the questions are conditional, where the second research question (RQ2) is dependent on the outcome of the first research question (RQ1). So, therefore, the result analysis for the plain PHP and Codeigniter shows that the differences between them are relatively small to plain PHP’s advantage. The plain PHP is only a dozen milliseconds faster and consumes a few bytes less memory than Codeigniter but if we see the LARAVEL version we can see that laravel takes a minimum time than both Codeigniter and procedural PHP. If the plain PHP application was large, it would mean that the plain PHP would not have been performing better than the Codeigniter and Codeigniter also will not be able to perform as efficiently as LARAVEL because as the application will get bigger LARAVEL performance will be getting better, as a result, LARAVEL execution time measurement is better than both. In the case of memory usage laravel takes a much larger time than both procedural PHP and Codeigniter but as the application gets bigger it would be easy to effort memory but execution time should be of much importance. That is because the growth of the stack trace in the plain PHP application would have caused a higher execution time and memory consumption. Plain PHP is mostly suited for smaller projects even if there are no obvious reasons to not use Codeigniter or laravel, but Codeigniter and laravel would be the preferred choice when developing larger projects.
Thanks for reading our post “Comparison with Php along with Codeigniter and Laravel Framework”, please connect with us for any further inquiries. We are Next Big Technology, a leading web & Mobile Application Development Company. We build high-quality applications to full fill all your business needs.