Comments and Vote unusable due to speed (resolved)

  • Posts: 180
  • Thank you received: 13
12 years 5 months ago #54888

I really love the way the Vote and Comments work and appear on the front-end. But I believe as it is, it is totally unusable. A product which takes under 2 seconds to load normally, takes over 5 seconds to load with voting and comments on. There are only two comments on the whole site and 5 votes, so it is not the volume.

As it stands, I can not sell a site to anyone where a product takes that long to load.

Last edit: 12 years 4 months ago by esotechie.

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 13
12 years 5 months ago #54927

I am trying to modify and use product/show_default to load the comments and vote after the page has loaded using jQuery. I have almost done it but can not locate the JS code that changes the input for the voting to stars for div hikashop_vote_stars. Can someone point me to the JS code that does that so I can run it after the Ajax load.

I'll post my fudge when I get it working :)

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 5 months ago #54994

Hi,

As far as I know that's already the case.
You can look at the view files of the view "vote" where you will see that the JS doing that is done after the product page loads:

<script type='text/javascript'>
			do_nothing( function() {
				var rating = new hikashop_ratings(document.getElementById('hikashop_vote_rating_id'), {
					id : 'hikashop_vote_rating_<?php echo $type_item; ?>_<?php echo $hikashop_vote_product_id;?>_',
					showSelectBox : false,
					container : null,
					defaultRating : <?php echo $hikashop_vote_average_score_rounded; ?>
				});
			});
		</script>

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 13
12 years 5 months ago #55008

Hi Nicolas

Thanks for the reply.

I thing you may have misunderstood my posts. I know the JS is converting the hikashop_product_vote_mini to show stars after the page loads.

I am rewriting the vote and comments areas, hikashop_product_vote_mini, hikashop_product_vote_listing and hikashop_product_vote_form to load AFTER the page has been loaded. The code which populates them in the product class, adds just over three seconds to a product page load. This time for me is not acceptable and believe will not be accepted by most clients.

I really want to use the feature which I think is a great addition to the component, so I am changing the code to load these divs after the page has displayed the product. Doing this it meant that the JS code for converting the input to stars had already run, so I need to run it again.

I am doing this without hacking the original code for the class and using the product/show_default, and some jQuery, which is why I called a fudge. I will have a go today and if it works, do a new three in the "how to" forum so other may use it.

Thanks again for pointing me in the right direction.

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 13
12 years 5 months ago #55018

Unfortunately it seems my idea will not work as far as the stars are concerned. The javascript is accessing elements in the html to build the interactive area, and of course because I am bringing the area in using jQuery (by using .load), it means the elements are not in the main body and the js does nothing.

Any ideas that would not involve rewriting your JS?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 5 months ago #55027

Yes, I doubt that a js loading is a good idea.
Instead I suggest to locate why it's slow for you and then we can think of a way to avoid the problem.
It's not normal that the votes interface takes more time to load that the whole rest of the page.

So let's try to understand the problem.
If you activate the debug mode of the joomla configuration, do you have a lot of queries related to votes ? How many ? What are they ?

Do you have speed issues when there is no votes/comments listed ? Or only when there are ?

If you disable the comments and only have the votes, does it changes anything ?

What if you disable the javascript of the page ? Does it displays faster (even if it doesn't display properly). That would indicate that the problem is not the process on the server's end but in the javascript handling the votes system.

Understanding all that will already help understand where is the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 13
12 years 5 months ago #55028

Thanks for the reply Nicolas

The interface does not take longer to load, the whole page takes longer. I am putting together several sites in the clothing and fashion industries, and the page loads on such sites are very very quick and it is what is expected. I personally think a delayed Ajax load is the best way to do this as the user sees the product straight away and the comments which are non-essential and usually at the bottom (often off-screen) can be lazyloaded.

Answer to your questions:
Q- do you have a lot of queries related to votes ? How many ? What are they ?
51 with 'Display vote in products page' = Yes
37 with 'Display vote in products page' = No

Q - Do you have speed issues when there is no votes/comments listed ? Or only when there are ?
This is irrespective of wether or not a product has any comments or votes. There is 1.5 second added on my local server running in MAMP which is like rocket for other pages such as category and product listings. Usually under 0.5 second for a page.

Q - If you disable the comments and only have the votes, does it changes anything ?
It speeds up by 1.5 seconds (product with no variations is 0.5 seconds and with variations 1.5 seconds - this issue is on another thread which you are also helping me with)

Q - What if you disable the javascript of the page ? Does it displays faster (even if it doesn't display properly).
It speeds up by less than 0.5 of a second. So the gathering of data is the slowest.

I have also tried using one of the base templates in case it was the template, but no change.

Last edit: 12 years 5 months ago by esotechie.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #55066

I checked on my end but the speed with and without votes is exactly the same (a few ms difference).
The HikaShop part of the page takes less that 0.4 sec even though the product has a characteristic and votes.
Products listings takes approximately the same time on my computer.

I don't see how you can have such difference.
Could you do a screenshot of the "vote" tab of the configuration ? Maybe there is something else...
Just to be sure, if you remove the view customizations you did on the product page, do you still have the problem ? :)

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55083

Thanks for the reply Nicolas.

One of the first things I tried was removing the customisation of the Hikashop files. So yes I still have the problem.

I have even set the page to render with the Atmic template so none of the modules render with it, nor are there any menus etc.

With votes off:

Application 0.000 seconds (+0.000); 0.76 MB (+0.758) - afterLoad
Application 0.017 seconds (+0.017); 2.44 MB (+1.678) - afterInitialise
Application 0.031 seconds (+0.014); 3.52 MB (+1.087) - afterRoute
Application 0.102 seconds (+0.071); 5.40 MB (+1.881) - afterDispatch
Application 1.552 seconds (+1.450); 5.64 MB (+0.238) - afterRender

With votes on:

Application 0.000 seconds (+0.000); 0.76 MB (+0.759) - afterLoad
Application 0.016 seconds (+0.016); 2.44 MB (+1.678) - afterInitialise
Application 0.027 seconds (+0.012); 3.52 MB (+1.087) - afterRoute
Application 0.103 seconds (+0.075); 5.57 MB (+2.042) - afterDispatch
Application 3.108 seconds (+3.005); 5.83 MB (+0.265) - afterRender

As you can see it is quite a large jump.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #55113

HikaShop processing happens before the afterDispatch. After the afterDispatch, it's the template and the modules processing. So it actually confirms that the problem is not in HikaShop.

It could come maybe from a system plugin which would have a hard time processing the HTML of the comments area for some reason ? You should check your plugins and try to disable them one by one to see if one helps.

The following user(s) said Thank You: esotechie

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55116

OK thanks Nicolas. I'll investigate further with that information. and let you know what I find for future reference.

Please Log in or Create an account to join the conversation.

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55117

Thanks for all your help Nicolas, it is jQueryEasy. It now loads in .4 seconds :).

Time to go and find out why the problem exists with the plugin.

Again many thanks for taking the time to help.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #55121

Thank you for your feedback on the issue. I'm glad you found the bottleneck.

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum