PHP Conference Japan 2019での発表資料(25分発表エディション)です https://fortee.jp/phpcon-2019/proposal/80fe2e57-a35d-48cd-9c78-4af5000cbeac
はじめまして。サーバーサイドエンジニアの中野(@Hiraku)です。2015年12月からメルカリで働いています。 2016年1月27日(水)の第98回PHP勉強会@東京にて、composerを速くする取り組みについて発表をしてきました。 composerはPHPにおける実質スタンダードなパッケージマネージャです。 このcomposer、日本で実行すると非常に遅く感じます。この原因は普通ならこう表現すると思います。 githubやpackagistが日本から遠いから composerの実装がよくないから しかし発表ではあえて「光が遅いから」という主張をしました。 一般常識として、光の速さ(真空中で秒速約30万km)はとてつもなく速いものという認識だと思います。しかし一方で、地球や宇宙の規模など極限的な状況に携わる仕事をしている人であれば「全然速くない、むしろ遅い」というのが普通の感覚です。
まだ 12 月早々ですが、PHP ユーザに素敵なクリスマスプレゼントが届きました。 いまや使うのが当たり前となった Composer ですが、複雑な依存解決に実行時間がかかるのがネックでした。 これは日本国内だけでなく、海外のユーザも同じで、皆がしょうがないと思いつつも、小さな不満を持ちながら使っていました。 そんな、ある�日、わずか 1 行のコードが追加されたことで、実行時間が、わずか半分になるという現象が起こりました。 Composer を倍速にするには? composer self-update を実行して、最新版にするだけです。 $ composer self-update 実際の効果 このコードの効果を見てみましょう。composer コマンドの --profile オプションを使って、実行時間と使用メモリ量を出力します。 $ composer update --dry-run
本連載では、Composerを使ったパッケージ管理を紹介します。PHPではデフォルトでインストールされているPEARがありますが、最近では、Composerというパッケージ管理ツールも使われつつあります。例えば、JavaなどではMavenのようなツールでパッケージ管理をしたり、Rubyではbundlerといったパッケージ管理が使われるなど、現在では多くの言語でパッケージ管理ツールが使われています。 パッケージ管理ツールを使うとプロジェクトで使われているライブラリの依存関係を管理しやすくなり、依存しているライブラリのインストールも簡単になります。CakePHPもComposerを使ってインストールができるようサポートしており、開発環境ではZend Studioなどでの標準サポートされているなど、PHPでの開発では必須知識といえるほどの広がりを見せています。 本連載では、Composerの導入
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く