I have table called “guids” that looks like this: From that I would like to get data in this format: Basically, I need to use multiple columns to build a nested array with grouped data. I know that I can achive that structure using foreach loop like this: But if possible I would like a more optimized solution on the
Tag: performance
cURL request (with Stripe API) slowing down page load times – optimal way to make the request?
I’m making a call at the beginning of each page of my site to Stripe (a payment/subscription service) using its API in PHP. I need to check if at any point the subscription has failed/changed so they lose access to the current page. The problem is that it seems to be slowing down my pages a lot, causing noticeable issues
Speed-up/Optimise MySQL statement – finding a new row that hasn’t been selected before
First a bit of background about the tables & DB. I have a MySQL db with a few tables in: films: Contains all film/series info with netflixid as a unique primary key. users: Contains user info “ratingid” is a unique primary key rating: Contains ALL user rating info, netflixid and a unique primary key of a compound “netflixid-userid” This statement
Handling hundreds of API requests in one time
I am trying to make a user dashboard which will generate reports of all of my 37 game accounts played by different gamers. so, for each i scrape data and then calculate the amount of rewards it generated. but for that i need to do hundreds of api requests and due to max_exec_time limit of 30sec it gives me a
Laravel 6 with Nginx, php 7.4 fpm and mysql 8 on docker is slower than Laravel 4 on php 7.1
I have been working on a site built on Laravel 4.2 and on Php 7.1. Recently I have been trying to migrate the site to Laravel 6 with php 7.4 and mysql 8. I setup docker with the following settings. …
How to see full query in New Relic
When I go to APM > Applications > PHP Application > Databases it shows the list of queries and their performance. But the queries are shown like
select. How can I see the full query?…Why is PHP7 so much faster than Python3 in executing this simple loop?
As an extremely simple benchmark, I executed the below simple code on PHP 7.0.19-1 and Python 3.5.3 (command line) on the same Raspberry Pi 3 model B. Python’s execution time was horrible in comparison to PHP’s (74 seconds vs 1.4 seconds). Can anyone help me understand why the execution takes so much longer on Python? Is there something I’m doing
Which is faster php date functions or carbon?
Carbon is simple PHP API extension for DateTime. I want to know that we can use datetime functions using by installing carbon via composer. which is faster php datetime functions or carbon ? Answer I did some testing regarding your comment comparing DateTime to Carbon functions: Calling Carbon::now() vs. new DateTime() 100.000 times: Results from 5 runs (meaning 5x 100.000
How to compress image before uploading in Laravel?
I’m making a images gallery website where users can upload any image and they will be displayed on frontend. I need to compress images without effecting it’s quality to reduce there size so that page load speed should not effect that much. I’m using following code to upload image: Answer You need to optimize the image for web usage as
Where to put arrays with constant value that will be accessed many times?
I have some arrays storing the possible parameters for some 3D printer commands. I use this to check if the command is legal. I am confused about where I should put these arrays. These arrays will only be accessed in the formatcheck function, and the function will be called many times as there are thousands of commands to check. Should