1 / 5

7 Performance Optimisation Tips For The Laravel Developer

If you're looking for a dedicated Laravel developer to help you speed up your development process, look no further than Hire. Our experienced developers have years of experience working with this popular php web application framework and can put their skills to work for your project quickly and efficiently.

Alliance59
Télécharger la présentation

7 Performance Optimisation Tips For The Laravel Developer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 7 Performance Optimisation Tips For The Laravel Developer I've been doing a lot of work with Laravel recently. The framework is an absolute joy to work with, but it isn't perfect. I have found that the default configuration settings are geared towards developer happiness rather than optimal performance for production servers. Every framework has its trade-offs and this is where customising your configuration files comes in handy. You can increase performance by making a few simple changes without having to sacrifice comfort or spend hours trying to understand how everything ticks behind the scenes. To help get you started here are seven tips to Hire Dedicated Laravel Developer. www.alliancerecruitmentagency.com

  2. 1. Use APC or XCache to cache Composer dependencies Composer downloads all of its packages into memory during installation. This means every time you install a package on your production server, you're loading a lot of unnecessary files from disk when it comes to getting started with your project. Most caching systems have the ability to store data in shared memory so that multiple processes can access them much quicker than if they had to do a database lookup every time. In PHP, APC is the standard and has been around for a long time but XCache seems to have better performance. I'm not going to go in-depth about either because there's already a great tutorial on the subject. 2. Use Moustache or Twig for your views instead of plain PHP Moustache and Twig are template languages that provide safe programming practices while allowing you to write clean, reusable code. I strongly recommend using one of these instead of raw PHP (even if it is heavily abstracted through an ORM like Eloquent) because there's no need to put business logic into your view files. These languages also offer plenty of functionality that will save you time in the future such as inheritance, loops, conditionals and access to Laravel helpers . www.alliancerecruitmentagency.com

  3. 3. Cache queries with Redis Redis can be used as a stateless in-memory cache backend but it has so much more to offer. You can also use it as a persistent datastore and implement pub/sub messages which make it great for inter-process communication (e.g your web server process notifying another worker to perform some task). Everything stored in Redis is keyed by an unique string. This means that you can store cached queries that are prefixed with the table name, model name and query parameters - this separates them from any other data stored on your server (and will work regardless of your application's directory structure). 4. Enable xdebug xdebug is extremely useful tool for debugging PHP code, but it will also show you exactly where time is being spent on each request at the OS level. Make sure you set a breakpoint in your app/routes. php file and check out what xdebug shows you about how long certain parts of your application took to run. www.alliancerecruitmentagency.com

  4. 5. Don't use APCu as a session handler APCu is a great little tool for storing data in shared memory which speeds up access times immensely, especially if your server doesn't have much RAM to spare - but I recommend not using it as a replacement for PHP's default session handlers because of one thing: serialization PHP has three mechanisms for caching objects between requests: APC, Memcache and Redis (and their accompanying drivers). 6. Use batch requests Batch requests are extremely useful when building APIs, webhooks or cron jobs that need to communicate with your application so they don't bog down your app with multiple database queries every time you make an HTTP request. 7. Profile before benchmarking your application One thing I can't stress enough is that you shouldn't use any profiling tools until you know how long something takes manually so you have an actual idea of what "too slow" means. If it takes 100ms to generate a page then that's fine for a production environment, but if it takes 500ms then there are going to be some big problems with the end user experience. Alliance Recruitment Agency is one of the leading global recruitment, staffing and executive search agencies. We operate through a network of our worldwide teams, with specialists in recruitment for different company. Contact Us to know more about us. Source :-https://internationalrecruitment.weebly.com/blog/7-performance- optimisation-tips-for-the-laravel-developer www.alliancerecruitmentagency.com

  5. Alliance Recruitment Agency 9179009072 www.alliancerecruitmentagency.com sales@alliancerecruitmentagency.com 104 Esplanade ave, 120 Pacific, CA 94044, USA www.alliancerecruitmentagency.com

More Related