title: Optimal way to paginate in symfony 4
body: <p>I'm building an API and I would like to know what is the best way to paginate in symfony (v4) and doctrine ORM.</p>
  
  <p>I've used some bundles such as knp paginator and Pagerfanta,but I'm asking because I'm concerned with performance when we have much data in the DB.
  would't be better to use Doctrine's Paginator and implements a pagination by myself ?</p>
  
  <p>thanks.</p>