Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6930125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:24:27+00:00 2026-05-27T11:24:27+00:00

Anybody got any performance tips for Symfony2 like use _, disable _ etc? Things

  • 0

Anybody got any performance tips for Symfony2 like “use _”, “disable _” etc? Things like cache and such, but less obvious things like using Doctrine2 query cache.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:24:27+00:00Added an answer on May 27, 2026 at 11:24 am

    Couple of (fairly basic) things from the Doctrine Docs

    Use array hydration for read only actions

    There is an extra overhead (memory, loading proxies and the like) associated with hydrating objects.

    If you are just displaying lists of items, or lists of entity properties for a single items (for example a product page, a list of recent blog articles, or most front end operations!) you can use
    $query->getResult(Query::HYDRATE_ARRAY);

    This approach can also prevent any accidental lazy-loading problems that may arise from the next point (due to the lack of proxies!)

    Beware of lazy loading when using entities with associations

    It can be tempting to over use some of Doctrine’s in-built repository methods $repo->findAll(), or to not explicitly define associations in your DQL (via joins) (for brevity/speed/whatever excuse!).

    Should a query return an array of (say Article) objects, that you then loop over in your view to display each article, and each article has a collection of comments. If you do not define an Eager load, or explicitly join the comment entity in the DQL, Doctrine will lazy load in the comment entities as requested (which is very useful in some cases). This means an extra SQL query per lazy load.

    If you were displaying a list of 10 articles, that would result in 1 query to get the article list, and an additional 10 queries to lazy load each comment association (when one one query is all that is needed!)

    By default Doctrine will fetch all all the properties for a given entity.

    This isn’t ideal on high traffic pages (equivalent to doing a SELECT *?). Especially if you are only using 1 or 2 properties for a given entity.

    Rather than

    $qb->select('Article')
           ->from('SomeBundle:Article');
    

    You could do

    $qb->select('Article.title')
           ->from('SomeBundle:Article');
    

    You can use Symfony’s profiler to keep an eye on how many queries are being generated by Doctrine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anybody got any experience in mapping a domain to an MVC area? Here's our
Has anybody got any kind of experience with dynamic programming using WCF. By dynamic
I'm thinking about a good workflow for php/mysql web-development. Anybody got some tips?
can anybody help me solve this : i got $filename= index 198.php; i use
Anybody got any good reading articles and tutorials on custom installers as most on
Has anybody out there got any real world experience with the H2 database ?
Anybody got any clue why this won't work with more than 1 date... it
Short question: Has anybody got any C# code to parse robots.txt and then evaluate
Has anybody got any idea where one can get documentation for stani python editor?
Has anybody got any suggestions for a custom tabcontrol implemented in C# and which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.