Symfony

Performance & Optimization

Profiler, Blackfire, query optimization, lazy loading, eager loading, caching strategies

22 pertanyaan wawancara·
Senior
1

What is the main purpose of the Symfony Profiler in the development cycle?

Jawaban

The Symfony Profiler is a debugging tool that collects detailed information about each HTTP request: execution time, SQL queries, memory usage, cache, events and more. It helps identify bottlenecks and analyze application behavior without modifying code. Unlike traditional logs, it provides an interactive graphical interface accessible via the Web Debug Toolbar.

2

How does Blackfire differ from Symfony Profiler for performance analysis?

Jawaban

Blackfire is a PHP application profiler that performs deep code analysis at the function-by-function level, with call graphs, profile comparisons and regression detection. Unlike Symfony Profiler which gives a per-request overview, Blackfire traces complete code execution with CPU, memory and I/O metrics at each function call. It also enables comparing performance between different code versions.

3

What is the difference between lazy loading and eager loading in Doctrine ORM?

Jawaban

Lazy loading loads relationships only when they are actually accessed in code, reducing initial load but potentially creating the N+1 problem with multiple additional queries. Eager loading loads relationships immediately with the main query via JOIN, avoiding extra queries but potentially increasing the amount of data transferred. The choice depends on how the data will be used.

4

How to identify and solve the N+1 queries problem with Doctrine?

5

What caching strategy to use for data that rarely changes but is read frequently?

+19 pertanyaan wawancara

Kuasai Symfony untuk wawancara berikutnya

Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.

Mulai gratis