AwsLambda + nodejs + mysql + ORMごとのInit Duration比較
環境
- nodejs 14.x
- メモリ 1024GB
- DB接続 => 1行取得 => 切断
- 試行回数 それぞれ3回くらい
- serverless framework 使用
- typescript 4
結果
ライブラリ | InitDuration |
---|---|
mysql2 | 270ms |
sequelize | 470ms |
typeorm | 780ms |
prisma | デプロイ出来んかった |
typeorm入れただけでけっこー重くなるの、ツラミがある。
typeormは、mysqlだけ使いたくてもpostgresql/oracle/sap/mongodbとか色々なコードが入ってしまうため、重くなってる模様。
Webpack Bundle Analyzerを見た感じだとprismaが非常にコンパクトだったので、期待したい。