Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3977958
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:59:11+00:00 2026-05-20T04:59:11+00:00

I have an algorithm written in PHP which communicates with MySQL. On standard shared

  • 0

I have an algorithm written in PHP which communicates with MySQL. On standard shared hosting server it takes about ~5 seconds to calculate. My question is – how can I speed it up (of course without changing the algorithm itself), use dedicated/VPS, maybe some cloud computing or…?

What are your suggestions?

EDIT: It’s Dijkstra algorithm for public transport. I have (only) 3500 unique stops.

In short – I have multiple arrays for recording active stops, previous stops, lineToStop, totalTime, travelingTime and so on. I loop for number of stops, get an id of a stop, build connections to other stops (based on the time on that active stop), loop again for size of stops() to find the one with the lowest value, mark it as active and continue again.

I realized it’s optimizatio problem so – > Dijkstra algorithm optimization/caching

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:59:11+00:00Added an answer on May 20, 2026 at 4:59 am

    When you buy an airline ticket, the first question is not “where do you want to go?” – it is “where are you going from?” In other words, without much, much, MUCH more detail, we’re just guessing.

    The surest answer for “How can I speed it up?” in any case is this:

    Measure it, find actual bottlenecks, remove bottlenecks, repeat until it runs well enough.

    Without profiling, you could waste endless hours on optimizing some part of the code that doesn’t have any significant performance impact (Note the emphasis on “actual bottlenecks” – many programmer-centuries were spent optimizing what someone imagined might be the bottleneck).

    Example: speeding up a method by 1000% is pointless, if it’s a method that gets called once at the start of your program, and the program spends 90% of its time waiting for disk I/O. Another example: making a disk array to help with I/O bottlenecks, when the program spends 90% of the time waiting for the SQL server which runs a complex, unindexed query. Those are not the only problems you could encounter, and they aren’t even mutually exclusive – but you need to know what problems you have before you start solving one. “It is slow” is not a description of a problem, it is just a symptom (just like “a headache” can be a symptom of 9000 different medical conditions).


    TL;DR: There is no silver bullet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay - I'm beaten. I have a (PHP-CLI) server written using PHP's socket_* functions.
Suppose my web app is written in PHP & Mysql on the standard LAMP
this is my algorithm that I have written it with my friends (which are
I have a recursive algorithm which steps through a string, character by character, and
I have a language-agnostic question about an algorithm. This comes from a (probably simple)
I have written the following function to calculate a check digit in R. verhoeffCheck
I have started a migration of a high energy physics algorithm written in FORTRAN
I have written a game playing program for a competition, which relies on some
I have an algorithm that generates strings based on a list of input words.
I have a two part question Best-Practice I have an algorithm that performs some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.