Multiple calls to getlist or filter array in php?

On the page you want to insert in several places the filtered list of elements of the information block. Filter by property of the information block (a list).

I saw three options for implementation:
1) getlist->array()->array_filter->cycle
One query generated by the array. Then divide the array into filero. Output the array in the right place.
2) getlist->array()->loop->condition
One query generated by the array. Output the array in the right place, filtered through the condition inside the loop.
3) getlist(filter)->output
Make a few getlist queries with filtering and immediately displayed.

How better to do, and why? I'm not good in performance, but I think a few getlist queries are worse than single, followed by filtration. All you need to do 5 filters for 35 records. I would be grateful if you share the link where to read about performance (for example, what will change if you need to do 30 filters, or records will be more than 1000).

In General, the question is: how does Bitrix competently implement multiple filtrations with the subsequent conclusion?
June 5th 19 at 21:11
2 answers
June 5th 19 at 21:13
if data is very small and especially if they are displayed, the first or the second option, which one makes no difference, still the same getList, then simply twist the array

if the data is large, say 1000, and you need to withdraw 3 blocks of 5 records with a different filter,

three or getList,

or one getList filter OR if it is an ancient api devour a triple filter, but it seems there are strictly two options samostalno
https://dev.1c-bitrix.ru/api_help/iblock/classes/c... Filter with complex logic
June 5th 19 at 21:15
How better to do, and why?
Correct - to implement all three options and each measure its performance. So not only do you choose the best option, but also gain skill and be able to answer such questions on the Toaster.
So I asked to not spend in time. The question is clearly already a lot of people decided, why not tell?
Especially in the Internet failed to find the answer. If you do not publish the question, the answer is not guslitsa (at least with my wording). - alexzander commented on June 5th 19 at 21:18
The problem is that your question is impossible to answer - it all depends on the table structure, the load on the database, the number of resources on the server the specific sample, the amount of data and moon phase. The only reliable option is to do as I said.

I can only say that between the first and second option noticeable difference in runtime and CPU load will not. - aniya commented on June 5th 19 at 21:21

Find more questions by tags 1C-Bitrix