Skip to content

Conversation

@kseni265
Copy link

No description provided.

Copy link
Collaborator

@spajic spajic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<% end %>
</ul>
<%= render "delimiter" %>
====================================================
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно использовать рендеринг коллекций.

Там не такая просадка производительности по сравнению с рендерингом паршлов в цикле

И даже можно параметром задать шаблон разделителя: https://guides.rubyonrails.org/layouts_and_rendering.html#spacer-templates

- Время выполнения (fixtures/1M.json): 137.6 сек
- Потребляемая память (fixtures/1M.json): 1895 MB

По памяти много, но по времени кажется неплохо. На этом результате решила остановиться пока, потому что времени катастрофически не хватает.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


### Итоги

Очень понравилось использовать pgHero, действительно удобный и визуально приятный инструмент.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Очень понравилось использовать pgHero, действительно удобный и визуально приятный инструмент.
С bullet и rack-mini-profiler немного уже работала, поэтому они остаются полезными)

P.S Прошу прощения за такую задержку с выполнением дз. Постараюсь наверстать все пропущенное до конца курса.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Претензий нет, задания чем дальше, тем проще, желаю удачи 👍

end

def find_city_id(name)
@cities[name] ||= ActiveRecord::Base.connection.execute("insert into cities (name) values ('#{name}') ON CONFLICT DO NOTHING RETURNING id").first['id']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как-то странно. кажется лучше это просто в виде Hash сделать, чтобы не делать лишних запросов в БД

)
end
end
Operations::Import.new.work(args.file_name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants