PHP Power vs. Database Lookup

  • # March 30, 2013 at 2:15 pm


    For example, if I wanted the outcomes to some fairly complex mathematical answers at what what point does php’s power become slower than it would be to store an answer in a database and look it up?


    # March 30, 2013 at 7:42 pm

    I once needed sin and cos so much I decided to make an array with 360 values for each (rounded to degrees was enough accuracy), which was a nice speed improvement. Looking up indexed keys in databases will be equally fast, but it’s hard to say at what point one will become faster then the other. I’d suggest to run your own benchmarks and see from there if it’s worth it.

    # March 31, 2013 at 6:39 am

    thanks, i like the array idea.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.