1

continued from here..

In the application we are currently writing we have the ability like IStockPhoto to search for images.

In the case of IStockPhoto, after it searches only the view where the images are loaded are refreshed while the other sections of the site remains.

For us, when we search or click pagination, we load the whole site and this comes with quite a performance hit. Since we are loading the scripts, images and facets (and since many of them are nested inside another it has to be recursively loaded) every time someone searches or wants to go to a different page number.

I was thinking of creating an AJAX control for our section where we load the images so we don't have to refresh the whole page. Hence, no need to reload js files, and no need to recursively load facets (I think this is where we have the most performance hit)

So the question is, should I try to create the AJAX control for retrieving stored images? And if so, are there a lot of changes I have to make in my Views and Controllers?

Or would there be some way I can optimize our loading time?

ps. When Solr is hit the first time, the page loading takes about 15-20 seconds (if my memory serves me correct) and afterwards, it takes about 3-6 seconds to load a site with 25 images in the page. Is that normal? It takes about 1-2.5 seconds to load a section in iStockPhoto.

Thank you...

Community
  • 1
  • 1
KoalaD
  • 357
  • 1
  • 4
  • 12
  • How many Solr queries are you running per request? What are the Solr qtimes for your queries? How many documents are you fetching per query? Are you using faceting? – Mauricio Scheffer Jan 12 '12 at 22:19
  • Are your times for page loads including the time it takes to load the images? If your images are large, this could be the bottleneck... You need to add some timings in your controller code to see where the bottlenecks are. Remember the old saying: "benchmark, don't optimize". Having said all that I've implemented something similar and I ended up using an AJAX approach. See http://biocache.ala.org.au/occurrences/search?taxa=kangaroo#imagesView – nickdos Jan 12 '12 at 22:35
  • @nickdos Have you started with a regular MVC3 views and controller and switched to AJAX? If you did, can you recommend a way for me to make the switch? Thanks :) – KoalaD Jan 13 '12 at 15:15
  • @MauricioScheffer I'm looking through my code, now :) First of all, Yes. I am using faceting. – KoalaD Jan 13 '12 at 15:15
  • @MauricioScheffer 1. I JUST found about the qtime and find that our largest solr content takes 6 milliseconds and our solrnet qtime is about 100 give or take. So I take it it's not entirely on the solr sid. Maybe it's due to the app fetching all assets when we first load the page. We don't wait until someone searches. We simply have all the assets readily available with all the faceting options on the left just like 'nickdos' has. And I'd say his site has about the same or a tad faster than my app. When I click on the next page number, it queries Solr again. Is that optimal? – KoalaD Jan 13 '12 at 18:35
  • > "When I click on the next page number, it queries Solr again. Is that optimal?". SOLR has pretty good caching so subsequent queries are always fast. So performance is not an issue, plus it means URLs are stateful and can be bookmarked or emailed, etc. – nickdos Jan 13 '12 at 20:38
  • I'm only using AJAX for the "images" tab content, so the actual HTML that is being generated from the AJAX response is relatively small. The rest of the page is standard JSP (Java & Spring MVC). I'm using JQuery for AJAX and DOM manipulation. You might want to look at JQuery templates if the AJAX generated HTML is large or complex - see http://stackoverflow.com/questions/170168/jquery-templating-engines – nickdos Jan 13 '12 at 20:47
  • Ah.. Yea as I timed my queries in Solr and for SolrNet I don't think the issue is in the SOLR. Thanks so much for the information! – KoalaD Jan 16 '12 at 14:01

0 Answers0