<commit_before><%
  # homeModels = VishConfig.getHomeModels({:return_instances => true})
  homeModels = [Excursion]
  resourcesRecommended = RecommenderSystem.resource_suggestions(current_subject, nil, {:n => 15, :models => homeModels})
  resourcesRecent = ActivityObject.getRecent(15,{:subject => current_subject, :ids_to_avoid => resourcesRecommended.map{|r| r.activity_object.id}, :models => homeModels})
  resourcesPopular = RecommenderSystem.search({:n => 16, :order => "ranking DESC", :ids_to_avoid => (resourcesRecommended+resourcesRecent).map{|r| r.activity_object.id}, :page => 1, :models=> homeModels})
%>

 <section id="excursions_tab_ready3 " class="excursions recent_excursions">
  <ul class="first_excursions">
    <%= render partial: 'excursions/excursion-add' %>
    <%= render partial: 'home_row', :locals => { :resources => resourcesRecent, :prefix_id=>"home" } %>
  </ul>
  <div id="last_content_shown" style="display:none"><%=t('search.end')%></div>
</section>

<section id="excursions_tab_ready2 " class="excursions foryou_excursions">
  <ul class="items">
    <h3> <%= t("home.foryou")%> </h3>
  <%= render partial: 'home_row', :locals => { :resources => resourcesRecommended, :prefix_id=>"home"} %>
  </ul>
</section>
 
<section id="home_tab_ready" class="excursions">
  <ul class="">
    <h3> <%= t("home.populars")%> </h3>
    <%= render partial: 'home_popular', :locals => { :resources => resourcesPopular, :ids_to_avoid => (resourcesRecommended+resourcesRecent+resourcesPopular).map{|r| r.activity_object.id}, :prefix_id=>"home"} %>
  </ul>
</section><commit_msg>Minor optimization for Home loading<commit_after><%
  # homeModels = VishConfig.getHomeModels({:return_instances => true})
  homeModels = [Excursion]
  resourcesRecommended = RecommenderSystem.resource_suggestions(current_subject, nil, {:n => 15, :models => homeModels})
  ids_to_avoid = resourcesRecommended.map{|r| r.activity_object.id}
  resourcesRecent = ActivityObject.getRecent(15,{:subject => current_subject, :ids_to_avoid => ids_to_avoid, :models => homeModels})
  ids_to_avoid += resourcesRecent.map{|r| r.activity_object.id}
  resourcesPopular = RecommenderSystem.search({:n => 16, :order => "ranking DESC", :ids_to_avoid => ids_to_avoid, :page => 1, :models=> homeModels})
  ids_to_avoid += resourcesPopular.map{|r| r.activity_object.id}
%>

 <section id="excursions_tab_ready3 " class="excursions recent_excursions">
  <ul class="first_excursions">
    <%= render partial: 'excursions/excursion-add' %>
    <%= render partial: 'home_row', :locals => { :resources => resourcesRecent, :prefix_id=>"home" } %>
  </ul>
  <div id="last_content_shown" style="display:none"><%=t('search.end')%></div>
</section>

<section id="excursions_tab_ready2 " class="excursions foryou_excursions">
  <ul class="items">
    <h3> <%= t("home.foryou")%> </h3>
  <%= render partial: 'home_row', :locals => { :resources => resourcesRecommended, :prefix_id=>"home"} %>
  </ul>
</section>
 
<section id="home_tab_ready" class="excursions">
  <ul class="">
    <h3> <%= t("home.populars")%> </h3>
    <%= render partial: 'home_popular', :locals => { :resources => resourcesPopular, :ids_to_avoid => ids_to_avoid, :prefix_id=>"home"} %>
  </ul>
</section>
{'fraction_non_alphanumeric': 0.18502475247524752, 'fraction_numerical': 0.008044554455445545, 'mean_word_length': 6.347727272727273, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '639779', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1097, 'n_words': 195}