# パフォーマンスと最適化 (Symfony) > Profiler、Blackfire、クエリ最適化、lazy loading、eager loading、キャッシュ戦略 - 22 面接問題 - Senior - [面接問題: Symfony](https://sharpskill.dev/ja/technologies/symfony/interview-questions.md) ## 1. 開発サイクルにおける Symfony Profiler の主な目的は何ですか? **回答** Symfony Profiler は、各 HTTP リクエストに関する詳細情報(実行時間、SQL クエリ、メモリ使用量、cache、events など)を収集するデバッグツールです。コードを変更せずにボトルネックを特定し、アプリケーションの動作を分析できます。従来のログとは異なり、Web Debug Toolbar からアクセスできるインタラクティブなグラフィカルインターフェースを提供します。 ## 2. パフォーマンス分析において Blackfire は Symfony Profiler とどのように異なりますか? **回答** Blackfire は、関数単位でコードを詳細に分析する PHP アプリケーションプロファイラで、call graphs、プロファイル比較、リグレッション検出を備えています。リクエスト単位の概要を示す Symfony Profiler とは異なり、Blackfire は各関数呼び出しごとに CPU、メモリ、I/O のメトリクスを取得しながらコードの完全な実行をトレースします。また、異なるバージョンのコード間でパフォーマンスを比較することもできます。 ## 3. Doctrine ORM における lazy loading と eager loading の違いは何ですか? **回答** lazy loading は、コード内で実際にアクセスされたときにのみリレーションを読み込むため、初期負荷を抑えられますが、複数の追加クエリによる N+1 問題を引き起こす可能性があります。eager loading は、JOIN を使ってメインクエリと同時にリレーションを即座に読み込むため、追加クエリを避けられますが、転送されるデータ量が増える可能性があります。どちらを選ぶかはデータの使われ方によって決まります。 ## さらに19問利用可能 - Doctrine で N+1 クエリ問題をどのように特定し解決しますか? - めったに変更されないが頻繁に読み込まれるデータには、どのキャッシュ戦略を使用すべきですか? 無料で登録: https://sharpskill.dev/ja/login ## その他のSymfony面接トピック - [モダンPHP (8.1+)](https://sharpskill.dev/ja/technologies/symfony/interview-questions/php-modern-features.md): 20問, Junior - [Symfony の基礎](https://sharpskill.dev/ja/technologies/symfony/interview-questions/symfony-basics.md): 25問, Junior - [Routing & Controllers](https://sharpskill.dev/ja/technologies/symfony/interview-questions/routing-controllers.md): 20問, Junior - [Twig & Templates](https://sharpskill.dev/ja/technologies/symfony/interview-questions/twig-templates.md): 20問, Junior - [Doctrine ORM の基礎](https://sharpskill.dev/ja/technologies/symfony/interview-questions/doctrine-orm-basics.md): 25問, Junior - [Symfony フォーム](https://sharpskill.dev/ja/technologies/symfony/interview-questions/forms.md): 22問, Junior - [データバリデーション](https://sharpskill.dev/ja/technologies/symfony/interview-questions/validation.md): 18問, Junior - [Dependency Injection & Services](https://sharpskill.dev/ja/technologies/symfony/interview-questions/dependency-injection.md): 24問, Mid-Level - [Security & Authentication](https://sharpskill.dev/ja/technologies/symfony/interview-questions/security-authentication.md): 26問, Mid-Level - [Doctrine 上級](https://sharpskill.dev/ja/technologies/symfony/interview-questions/doctrine-advanced.md): 24問, Mid-Level - [API Platform](https://sharpskill.dev/ja/technologies/symfony/interview-questions/api-platform.md): 22問, Mid-Level - [Serializer Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/serializer.md): 20問, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/ja/technologies/symfony/interview-questions/events-subscribers.md): 20問, Mid-Level - [Console & Commands](https://sharpskill.dev/ja/technologies/symfony/interview-questions/console-commands.md): 18問, Mid-Level - [Messenger Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/messenger.md): 22問, Mid-Level - [HTTP Client](https://sharpskill.dev/ja/technologies/symfony/interview-questions/http-client.md): 18問, Mid-Level - [キャッシュとパフォーマンス](https://sharpskill.dev/ja/technologies/symfony/interview-questions/cache.md): 20問, Mid-Level - [Workflow Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/workflow.md): 18問, Mid-Level - [Testing Symfony](https://sharpskill.dev/ja/technologies/symfony/interview-questions/testing.md): 22問, Mid-Level - [Mailer Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/mailer.md): 16問, Mid-Level - [翻訳と i18n](https://sharpskill.dev/ja/technologies/symfony/interview-questions/translations.md): 16問, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/ja/technologies/symfony/interview-questions/easyadmin.md): 18問, Mid-Level - [Symfony アーキテクチャ](https://sharpskill.dev/ja/technologies/symfony/interview-questions/architecture-patterns.md): 24問, Senior - [高度なセキュリティ](https://sharpskill.dev/ja/technologies/symfony/interview-questions/security-advanced.md): 22問, Senior - [カスタムバンドル](https://sharpskill.dev/ja/technologies/symfony/interview-questions/custom-bundles.md): 20問, Senior - [Symfony によるマイクロサービス](https://sharpskill.dev/ja/technologies/symfony/interview-questions/microservices.md): 22問, Senior - [Real-time & WebSockets](https://sharpskill.dev/ja/technologies/symfony/interview-questions/real-time.md): 18問, Senior - [Deployment & DevOps](https://sharpskill.dev/ja/technologies/symfony/interview-questions/deployment-devops.md): 20問, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ja/technologies/symfony/interview-questions/performance-optimization