Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
how require kill spring
Search
Fumiaki MATSUSHIMA
March 25, 2015
Programming
220
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
how require kill spring
永和システムマネジメント・DeNA 技術交流会発表資料
Fumiaki MATSUSHIMA
March 25, 2015
Transcript
41 slides
(株)永和システムマネジメント @mtsmfm 松島 史秋 springの死について 私が知っている1つの方法
松島 史秋 GitHub, Twitter @mtsmfm
None
ある rails 3.2 案件
spring の死
spring の死 \LoadError/
TL;DR rails 上で requireするな
TL;DR rails 上で requireするな ※ ただし stdlib は除く
$ bundle exec spring rspec
Expected /... /break_spring/app/models /animal.rb to define Animal (LoadError)
None
あるから!
None
None
???
$ bundle exec spring rspec すると何が起きるか
※ spring 1.3.3 ※ rails 3.2 のデフォルト設定の場合 ※ rails 4
~> のデフォルト設定の場合は発 生しません
$ bundle exec spring rspec (1回目)
1. gem とか require 2. app 以下とか load 3. テスト実行
(1回目)
簡易 spring
None
require & load run command
None
$ bundle exec spring rspec (2回目、変更無)
(2回目、変更無) 1. gem とか require 2. app 以下とか load 3.
テスト実行
1. gem とか require 2. app 以下とか load 3. テスト実行
(2回目、変更無)
1. gem とか require 2. app 以下とか load 3. テスト実行
(2回目、変更無) fork 前 fork 後
1. gem とか require 2. app 以下とか load 3. テスト実行
(2回目、変更無) fork 前 fork 後
$ touch app/models/cat. rb
$ bundle exec spring rspec (3回目、変更有)
1. load したのを const_remove 2. テスト実行 3. const_missing で require
(3回目、変更有)
1. load したのを const_remove 2. テスト実行 3. const_missing で require
(3回目、変更有)
require 済
require ‘animal’ # => false
Expected /... /break_spring/app/models /animal.rb to define Animal (LoadError)
※ spring 1.3.3 ※ rails 3.2 のデフォルト設定の場合 ※ rails 4
~> のデフォルト設定の場合は発 生しません
1. gem とか require 2. app 以下とか load 3. テスト実行
4. const_missing で require
1. gem とか require 2. app 以下とか load 3. テスト実行
4. const_missing で require fork 前 fork 後
Rails 3 config.cache_classes = true (eager_load = true を兼ねてる) Rails
4 config.cache_classes = true config.eager_load = false
TL;DR rails 上で requireするな ※ ただし stdlib は除く
stdlib の イケてる require 場所 どこ
More Decks by Fumiaki MATSUSHIMA
See All by Fumiaki MATSUSHIMA
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
150
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
260
Learning from performance improvements on GraphQL Ruby
mtsmfm
1
1.4k
Ruby で作る Ruby (物理)
mtsmfm
1
330
GraphQL Ruby benchmark
mtsmfm
1
940
タイムアウトにご用心 / Timeout might break application state
mtsmfm
6
2.7k
Build REST API with GraphQL Ruby
mtsmfm
0
420
GraphQL Ruby をちょっとだけ速くした / Make graphql-ruby faster a bit
mtsmfm
1
820
Gaming PC on GCP
mtsmfm
0
840
Other Decks in Programming
See All in Programming
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
160
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
760
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
270
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
440
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
310
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
290
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
170
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.4k
Spec-driven Development with AI
simas
PRO
0
2.3k
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
protojson における文字化けの扱い
kazuki1023
0
450
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Everyday Curiosity
cassininazir
0
410
Tell your own story through comics
letsgokoyo
1
1.1k
Claude Code のすすめ
schroneko
67
230k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
エンジニアに許された特別な時間の終わり
watany
109
250k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
It's Worth the Effort
3n
188
29k
Speed Design
sergeychernyshev
33
2.2k
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
820
Become a Pro
speakerdeck
PRO
31
6.4k
Why Our Code Smells
bkeepers
PRO
340
58k