diff --git a/app/assets/javascripts/discourse/views/cloaked-collection.js.es6 b/app/assets/javascripts/discourse/views/cloaked-collection.js.es6 index 7e5bb25e418..d082242bab4 100644 --- a/app/assets/javascripts/discourse/views/cloaked-collection.js.es6 +++ b/app/assets/javascripts/discourse/views/cloaked-collection.js.es6 @@ -83,7 +83,16 @@ const CloakedCollectionView = Ember.CollectionView.extend({ const mid = Math.floor((min + max) / 2), // in case of not full-window scrolling $view = childViews[mid].$(), - viewBottom = $view.position().top + wrapperTop + $view.height(); + + // .position is quite expensive, shortcut here to get a slightly rougher + // but much faster value + parentOffsetTop = $view.offsetParent().offset().top, + offsetTop = $view.offset().top, + + viewBottom = (offsetTop - parentOffsetTop) + wrapperTop + $view.height(); + + + console.log(viewBottom); if (viewBottom > viewportTop) { max = mid-1; diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 90ca84d3e4c..82fc7339e7f 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1185,7 +1185,7 @@ en: delete_drafts_older_than_n_days: Delete drafts older than (n) days. - vacuum_db_days: "Run VACUUM FULL ANALYZE to reclaim DB space after migrations (set to 0 to disable)" + vacuum_db_days: "Run VACUUM ANALYZE to reclaim DB space after migrations (set to 0 to disable)" prevent_anons_from_downloading_files: "Prevent anonymous users from downloading attachments. WARNING: this will prevent any non-image site assets posted as attachments from working." diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 8d23222512d..e34ac22d418 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -11,12 +11,12 @@ task 'db:migrate' => ['environment', 'set_locale'] do if SiteSetting.vacuum_db_days > 0 && SiteSetting.last_vacuum < (Time.now.to_i - SiteSetting.vacuum_db_days.days.to_i) - puts "Running VACUUM FULL ANALYZE to reclaim DB space, this may take a while" + puts "Running VACUUM ANALYZE to reclaim DB space, this may take a while" puts "Set to run every #{SiteSetting.vacuum_db_days} days (search for vacuum in site settings)" puts "#{Time.now} starting..." begin - Topic.exec_sql("VACUUM FULL ANALYZE") + Topic.exec_sql("VACUUM ANALYZE") rescue => e puts "VACUUM failed, skipping" puts e.to_s