感謝您的回覆。
這裏是mysql查詢日誌的結果:
Organization :: all(); - 1.6772060394287秒
130710 9:52:43 5 Connect [email protected] on seltec
5 Prepare set names 'utf8' collate 'utf8_unicode_ci'
5 Execute set names 'utf8' collate 'utf8_unicode_ci'
5 Close stmt
5 Prepare select * from `users` where `id` = ? limit 1
5 Execute select * from `users` where `id` = '2' limit 1
5 Close stmt
5 Prepare select * from `t_organisations`
5 Execute select * from `t_organisations`
130710 9:52:44 5 Close stmt
130710 9:52:45 5 Quit
DB :: table('t_organisations') - > get(); - 0.13963603973389秒
130710 9:55:16 6 Connect [email protected] on seltec
6 Prepare set names 'utf8' collate 'utf8_unicode_ci'
6 Execute set names 'utf8' collate 'utf8_unicode_ci'
6 Close stmt
6 Prepare select * from `users` where `id` = ? limit 1
6 Execute select * from `users` where `id` = '2' limit 1
6 Close stmt
6 Prepare select * from `t_organisations`
6 Execute select * from `t_organisations`
6 Close stmt
6 Quit
所以沒有什麼區別有那麼....這意味着延遲必須位於雄辯PHP代碼。是的,我安裝了xdebug,不,我不準備浪費我的時間,試圖找出它爲什麼慢!如果查詢生成器的速度更快,那對我來說已經足夠了!
@Laravels的開發人員:在框架上做的很好。它很直觀,很好地處理授權,特別是使用Leroy Merlin的信任和委託插件。雖然你可能想看看Eloquent的性能問題!
乾杯! Craig
就我個人而言,我會運行它通過XDebug來查看浪費的時間。 –
您的模型中是否定義了任何關係?如果是這樣的話 - 雄辯需要做大量的連接... – Laurence
總是有一些事情最好使用查詢生成器,特別是在處理大數據時。 – crynobone