Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
blitz_test_speed.pdf
Search
Tetsuya Fukuda
February 03, 2023
Technology
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
blitz_test_speed.pdf
Tetsuya Fukuda
February 03, 2023
More Decks by Tetsuya Fukuda
See All by Tetsuya Fukuda
アプリケーションの拡大に伴う開発者体験の悪化をなんとかする
ghken
0
65
辛くない受託開発
ghken
0
3k
Other Decks in Technology
See All in Technology
SRE歴2ヶ月でも開発6年の知見を活かして、チームで止まっていた環境改善を前に進めた話
a_ono
0
170
4人目のSREはAgent
tanimuyk
0
360
『AIに負けない』より『AIと遊ぶ』」〜ワクワクが最強のテスト・QA学習戦略_公開用
odan611
1
330
製造現場での生成AIの活用、およびエージェントAIの実装のあり方、AVEVAの取り組み
iotcomjpadmin
0
210
AIをフル活用してオンコール機能のプロトタイプを2日で作った話 / Building an AI-Powered On-Call Prototype in Just Two Days
nari_ex
0
160
#エンジニアBooks 30分でわかる 「技術記事を書く技術」 / engineer-books 2026-06-30
jnchito
1
160
AWS Summit Japan 2026の振り返りと2027へ向けて / AWS Summit Japan 2026 Recap and Prospects for 2027
kaminashi
1
170
AWS Summit の片隅で、体育座りしながらコミュニティがにぎわう理由を考えた
k_adachi_01
2
330
AI・ロボティクスと自動化社会 / AI, Robotics, and the Automated Society
ks91
PRO
0
140
フルAIで個人開発して学んだあれこれ / yuruai vol.1
isaoshimizu
0
160
技術・能力を向上する原理原則 #きのこセッションa #きのこ2026
bash0c7
0
190
そこにあるから地図ができる~位置を示す"モノ"を愉しむ~ - Interface 2026年6月号GPS特集オフ会 / interface_202606_GPS_offline
sakaik
1
180
Featured
See All Featured
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
880
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Side Projects
sachag
455
43k
Automating Front-end Workflow
addyosmani
1370
210k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
400
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
380
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
210
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
Transcript
Blitz.jsのテスト遅い問 題を解決したい!! KYOTO.JS 18
自己紹介 GHKEN Twitter: @gendaihyousyou RIT Inc. CTO/CHRO ◦ Next, Rails,
AWS多め 2歳の娘と0歳の息子
Blitz.js使ってますか? Next.js + Prismaなフルスタックフレームワーク スポンサーやってます
課題
テストが遅い
テストが遅い
単純な例で確認してみる
単純な例で確認してみる
テストが増えるとどうなるか
テストが増えるとどうなるか
どうやらこいつが悪そう
db.$resetは何をしてるのか
db.$resetを使わずにど うするか
Railsだとどうなってる?
SAVEPOINTを使ってる
ただ、現状のPrismaではサポートされてなさそう
truncateしてみる
おもったより早くない
なぜか
deleteにしてみる
早くなった
結論 ⚫db.$resetを使わない ⚫データが少ないならtruncateではなくdeleteのほうが早い ⚫(今回は問題に遭遇しなかったけど)deleteだけだとauto incrementずれるので注意 ⚫RailsだとSAVEPOINT使ってネストしたトランザクションからロールバックしてるので早い