Welcome Guest, Not a member yet? Register   Sign In
performance
#1

[eluser]outtolunch[/eluser]
Hello,

I was wondering, how i could increase the performance of getting-displaying results from the database.

I've got a massive SQL query, which runs through data in a table called "ads" according the latitude and longitude of the postcodes listed in the other table called "postcodes".

It starts with the small radius to get the nearest "ads" and if it doesn't find anything it increases the radius and moves on till it finds something.

It some good maths hidden in that sql query to get the results in a "circle" for the accuracy purposes.

Everything is processed within the "model", while executing the sql queries and printing the results into the tables, after that i just call the model function within the "view" to display it on the page.

The whole thing works nicely, just a bit too slow. Previously it was laying on a "hand/hard-coded" php website. I decided to put everything into codeigniter.

I've checked the elapsed time, which says 1-1,5 seconds, I would like to make 0,5-0,8 seconds if thats possible.


If someone has some tips & tricks, i would be please to listen to that.
#2

[eluser]outtolunch[/eluser]
i found out what makes my thing so slow..
#3

[eluser]lenwood[/eluser]
Will you share so the rest of us can learn?
#4

[eluser]outtolunch[/eluser]
Well to get the data in text format is not a problem (my website uses a database from other website).

The problem was -> images. I'm trying to get them externally from other website and crop them down so thats why it's so slow.

My solution would be to copy down the images from the other website and keep in mine and do a "check" if new stuff has been added to other website and copy down those images to mine again, so I would do the image processing locally.

Is there a better idea?




Theme © iAndrew 2016 - Forum software by © MyBB