A
A
Andrey Demidenko2015-02-17 02:00:53
Ruby on Rails
Andrey Demidenko, 2015-02-17 02:00:53

Should I use partial if there are a lot of them?

There are several partials, I looked in the log that the render of each partial is 3.5ms on average. In rails in production, will all partials be replaced by a single file in which they are included?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Vsk, 2015-02-17
@Dem1

Party a ly.
Use is possible. Even necessary.
The main task is to make the code readable and maintainable.
Cases when it is necessary to optimize rendering tend to zero. And even when it comes to them - no one unites the partials.
Plus, perhaps, thanks to partials, the user can get the page in parts - that is, subjectively "faster". Under certain conditions
Nothing will be replaced in production. Asking such questions should not be.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question