logoalt Hacker News

zahlman • today at 1:51 AM • 1 reply • view on HN

I assume the reason this is faster is because they cache for specific values of M?


Replies

shermantanktop • today at 3:32 AM

Imagine the filter is not trivial but instead involves deep inspection of each item and calls to an external service. Bounding the max number of expensive calls and enabling parallelism is more important than returning exactly the requested number of items.

For a real world example, imagine a personalized search query that ranks and filters based on the user’s history.