Performance of large results sets

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Performance of large results sets

This topic contains 11 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 years, 4 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #26251
    thenetking24
    thenetking24
    Participant

    While researching your plugin, I came across a few questions about max number of items the plugin can handle. I believe there were claims that 5-10k items would be fine.

    The client has 400 items loaded, with 24 items being displayed on each page. The initial page load takes 10 seconds or more on a pretty powerful server. I have not looked at scaling images down for these thumbnail views, so the images are still full res and rather large. But I don’t understand why its loading all 400 items that are mostly sitting behind pages that are not currently active/in view.

    Is there an easy way to lazy load these images?

    What does it take to use wordpress image resizing to get the thumbnails loading the smaller images?

    Thanks

    #26254
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Loading 400 items at the same time via the plugin? I am not sure if that is a good idea whatsoever. That is not the same as searching for a few dozen of items from a potential list of hundreds of thousands of posts. Pushing that many elements to one page will definitely spike the browser perfromance, it is no longer an issue that the plugin has to handle. The actual search may only take a fraction of second, but then parsing all the item titles, requesting the images from the database etc.. can be really painful to any server, and then displaying all that information in the browser is a task for the client PC.

    There is actually a built-in lazy loading script that you can enable, it will not load the images until paginated or in viewport. I would also strongly recommend enabling caching, it will help tremendously for displaying 400 items at once.
    There is also an automatic image cropping script that creates the closest image thumbnail sizes to the results.

    You can also define the preferred image source sizes under the General Options -> Image options panel.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26256
    thenetking24
    thenetking24
    Participant

    Thank you.

    I understand the issue with sending so many results to the browser, but I am was only expecting the browser to have to worry about a single page of results at a time.

    The built in lazy loading sounded like what I needed, but it’s already enabled and doesn’t seem to change functionality. Clicking on any page has the images loaded into memory already.

    I was under the impression the initial load would show 1 – 24 of 5000 results, and only load the 24 results of the first page, and then only load the images of whatever page the user attempts viewing. And then if the user picks a category or completes a search that has up to say 500 results, it would do the same thing. Is there a different, better way to load these results?

    Thanks again

    #26257
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    In that case I would suggest using the more result loader. It will automatically trigger the search when reaching the last page (or result) to load more of them.
    It is hard-limited to load at max 10 batches of the actual limit. So if you set a results limit 24, then the script will trigger 10 times at most, giving approximately 240 results, no more. Each batch loads additional 24 items.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26258
    thenetking24
    thenetking24
    Participant

    Are there other settings that will cause this not to function? I’ve had it enabled recently but the client did not like the functionality.

    I am trying to enable it now and nothing is changing on the front end.

    #26259
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Have you decreased the results limit?

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26260
    thenetking24
    thenetking24
    Participant

    General options – Limits – Post type results limit is set to 999, on results page is set to 999.
    General options – Logic & Behavior – Results count per page? is set to 999.

    Is there anywhere else to check for this limit?

    #26268
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    General Options -> Limits, that is the one for search results. You should lower that to the number, that you want to see at the first iteration (24 or 20 or 30 or whatever fits best).
    Also, check this option (if it’s not disabled automatically), and change it to the same number.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26288
    thenetking24
    thenetking24
    Participant

    Thanks again,

    I’ve spent some time playing with different setups and limits. I am extremely confused why I am not able to get this functioning decently. Setting Options -> limits to 24 causes the max results to stop at 240, which is inline with what you mentioned previously. So is the only way to show more of a potentially 25,000 item database, to increase this per page limit to a 10th of 25k?

    Is there any method to cause this to load pages/pagination the same way wordpress does by default, where it only pulls the items per page? Would the new elementor setup allow me to create an “archive home” that has pagination working this way with the filters?

    I’m stuck trying to understand how this can handle databases of 25k and I can’t get a couple hundred items to display in any type of reasonable time. Am I using options or configurations that cause this delay, or is this delay not a consideration when handling large data sets?

    Thank you

    #26289
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Again, searching and displaying a minor subset of 25k items is very different from displaying 25k items at once.
    What you are looking for is to display a number of elements at once, per page, and possibly refresh that page, when the user hits the pagination. The plugins live results container is not built for this, it is to display thousands of items at once obviously, browsers will have a hard time with that.

    I can think of two possibilites:

    1. To increase the iteration count to display more results at once within the live container. By default this number is 10, the custom code below increases it to 100. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter( 'asp_query_args', 'asp_change_remaining_limit_mod', 10, 2 );
    function asp_change_remaining_limit_mod( $args, $id ) { 
      
      $args['_remaining_limit_mod'] = 100;
      
      return $args;
    }

    2. Instead of the default live results container, use an Elementor posts widget. This is a fairly new feature, but it works almost exactly as you need it. The pagination will refresh the page every time.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26331
    thenetking24
    thenetking24
    Participant

    Thanks, the elementor setup solves the performance issue once I hack this interface to look like the other.

    Is there any chance I can call just the filters and just the search bar, the other shortcodes don’t seem to change this output.

    Is there a way to do this with WordPress query code instead of elementor?

    Thanks again

    #26344
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Is there any chance I can call just the filters and just the search bar, the other shortcodes don’t seem to change this output.
    I don’t understand what do you mean by this, can you please explain?

    Is there a way to do this with WordPress query code instead of elementor?
    Unfortunately no, there is no wordpress integrated shortcode/element that supports this. You can do it on the results page via the live loader feature, but that is different.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.