GithubHelp home page GithubHelp logo

Performance Issue about smart_listing HOT 6 CLOSED

sology avatar sology commented on August 27, 2024
Performance Issue

from smart_listing.

Comments (6)

Phitherek avatar Phitherek commented on August 27, 2024

SmartListing has been tested only with ERB and Haml. We do not know the impact of using other template engines on its performance, but it seems to be an issue of Slim and not SmartListing. For comparison, here is the log for rendering 6 SmartListings on one page using Haml:

Started GET "/smart_listing" for 127.0.0.1 at 2014-05-23 15:52:04 +0200
Processing by SmartListingController#index as HTML
   (0.2ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
   (0.3ms)  SELECT COUNT(*) FROM "sample_texts"  WHERE "sample_texts"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
   (0.3ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7' AND "users"."id" IS NULL
--- []
  User Load (0.4ms)  SELECT  "users".* FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7' LIMIT 3 OFFSET 0
  Rendered smart_listing/_user_simplest.html.haml (5.6ms)
  Rendered smart_listing/_user_simplest.html.haml (0.3ms)
  Rendered smart_listing/_user_simplest.html.haml (0.2ms)
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_links.html.erb (11.3ms)
  Rendered smart_listing/_users_simplest_list.html.haml (41.4ms)
--- []
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.3ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.3ms)
  User Load (0.5ms)  SELECT  "users".* FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'  ORDER BY name asc LIMIT 3 OFFSET 0
  Rendered smart_listing/_user_sorting.html.haml (0.3ms)
  Rendered smart_listing/_user_sorting.html.haml (0.2ms)
  Rendered smart_listing/_user_sorting.html.haml (0.2ms)
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_links.html.erb (11.1ms)
  Rendered smart_listing/_users_sorting_list.html.haml (42.3ms)
--- []
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.3ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.3ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.3ms)
  CACHE (0.0ms)  SELECT  "users".* FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'  ORDER BY name asc LIMIT 3 OFFSET 0
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_custom.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_edit.html.erb (0.3ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_delete.html.erb (0.4ms)
  Rendered smart_listing/_user_actions.html.haml (5.9ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_custom.html.erb (0.3ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_edit.html.erb (0.3ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_delete.html.erb (0.3ms)
  Rendered smart_listing/_user_actions.html.haml (6.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_custom.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_edit.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_delete.html.erb (0.4ms)
  Rendered smart_listing/_user_actions.html.haml (6.0ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_item_new.html.erb (0.8ms)
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_links.html.erb (11.7ms)
  Rendered smart_listing/_users_actions_list.html.haml (64.7ms)
--- []
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.3ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.3ms)
  CACHE (0.0ms)  SELECT  "users".* FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'  ORDER BY name asc LIMIT 3 OFFSET 0
  Rendered smart_listing/_user_controls.html.haml (0.3ms)
  Rendered smart_listing/_user_controls.html.haml (0.3ms)
  Rendered smart_listing/_user_controls.html.haml (0.3ms)
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_links.html.erb (11.2ms)
  Rendered smart_listing/_users_controls_list.html.haml (42.4ms)
---
- :data:
    :callback_href: "/smart_listing/users/select"
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.4ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_sortable.html.erb (0.4ms)
  CACHE (0.0ms)  SELECT  "users".* FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'  ORDER BY name asc LIMIT 3 OFFSET 0
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_custom.html.erb (0.3ms)
  Rendered smart_listing/_user_cart.html.haml (3.7ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_custom.html.erb (0.2ms)
  Rendered smart_listing/_user_cart.html.haml (2.3ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_action_custom.html.erb (0.3ms)
  Rendered smart_listing/_user_cart.html.haml (2.7ms)
  CACHE (0.0ms)  SELECT COUNT(*) FROM "users"  WHERE "users"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_links.html.erb (10.3ms)
  Rendered smart_listing/_users_summary.html.haml (0.1ms)
  Rendered smart_listing/_users_cart_list.html.haml (51.7ms)
--- []
  SampleText Load (0.4ms)  SELECT  "sample_texts".* FROM "sample_texts"  WHERE "sample_texts"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7' LIMIT 3 OFFSET 0
  Rendered smart_listing/_sample_text.html.haml (3.6ms)
  Rendered smart_listing/_sample_text.html.haml (0.3ms)
  Rendered smart_listing/_sample_text.html.haml (0.3ms)
  CACHE (0.0ms)  SELECT COUNT(*) FROM "sample_texts"  WHERE "sample_texts"."session_id" = '6d5c30ccaedd6bc783436f088f20f521937ce2f7'
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.1ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_link.html.erb (0.2ms)
  Rendered /home/phitherek/github/Sology/smart_listing/app/views/smart_listing/_pagination_per_page_links.html.erb (8.0ms)
  Rendered smart_listing/_sample_texts_list.html.haml (34.7ms)
  Rendered smart_listing/index.html.haml within layouts/application (305.4ms)
Completed 200 OK in 342ms (Views: 323.3ms | ActiveRecord: 5.8ms)

from smart_listing.

pcriv avatar pcriv commented on August 27, 2024

Thank's @Phitherek, later i'll test with erb or haml and post my logs so we can detect if the problem is slim, or maybe the vm where i'm running my app.

from smart_listing.

ljachymczyk avatar ljachymczyk commented on August 27, 2024

Hello @pablocrivella,
Any news about this issue?

from smart_listing.

pcriv avatar pcriv commented on August 27, 2024

@ljachymczyk sorry i didn't have time to test this with erb or haml in my vm, you can close this issue if you want. i'll give feedback anyway as soon as i can test this issue.

from smart_listing.

pcriv avatar pcriv commented on August 27, 2024

The rendering is still too slow with EBR. So the problem must be my vm.
Here are the logs.

Started GET "/items?items_smart_listing%5Bpage%5D=2" for 10.0.2.2 at 2014-06-15 12:12:52 -0400
Processing by ItemsController#index as JS
  Parameters: {"items_smart_listing"=>{"page"=>"2"}}
   (2.1ms)  SELECT COUNT(*) FROM "items"
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_sortable.html.erb (2.1ms)
  Item Load (1.6ms)  SELECT  "items".* FROM "items"  LIMIT 10 OFFSET 10
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (1.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (1.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (2.1ms)
  Rendered items/_item.html.erb (1098.9ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (0.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (0.3ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.9ms)
  Rendered items/_item.html.erb (1051.7ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (1.3ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.7ms)
  Rendered items/_item.html.erb (1091.7ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (0.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.9ms)
  Rendered items/_item.html.erb (994.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (0.3ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (0.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.7ms)
  Rendered items/_item.html.erb (1144.8ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (0.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (1.7ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.6ms)
  Rendered items/_item.html.erb (1039.9ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (0.3ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.7ms)
  Rendered items/_item.html.erb (1114.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (0.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.6ms)
  Rendered items/_item.html.erb (986.0ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (0.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (0.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.8ms)
  Rendered items/_item.html.erb (1205.7ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_custom.html.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_edit.html.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_action_delete.html.erb (0.8ms)
  Rendered items/_item.html.erb (1041.1ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_item_new.html.erb (4.0ms)
  CACHE (0.0ms)  SELECT COUNT(*) FROM "items"
  Rendered items/_list.html.erb (16581.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.1.0@todo/gems/smart_listing-1.0.0/app/views/smart_listing/_update_list.js.erb (16994.3ms)
  Rendered items/index.js.erb (17429.5ms)
Completed 200 OK in 18243ms (Views: 18220.3ms | ActiveRecord: 3.7ms)

from smart_listing.

ljachymczyk avatar ljachymczyk commented on August 27, 2024

Closing then.

from smart_listing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.