Rails rails db:migrate, rails generate migration 这些命令的速度到底取决于什么?

gaicitadie · June 30, 2020 · Last by leilei replied at June 30, 2020 · 2093 hits

CPU 主频?磁盘 io? 在 vps 上运行的最快,哪怕 cpu 只有两个核心,苹果笔记本上运行第二快,哪怕主频不如台式机。台式机上最慢,虽然是 6 核 12 线程被我超频到了 4.0G

难道取决于磁盘 io?

取决于磁盘速度,也受文件目录复杂度影响

http://tenderlovemaking.com/2011/11/30/psa-the-number-of-gems-installed-on-your-system-can-impact-rails-boot-time.html

大概是 Rails boot 过程,会从 RubyGems 目录寻找对应的 Gem 文件 require 加载到内存。

https://twitter.com/tenderlove/status/1235238664915079172

You need to Sign in before reply, if you don't have an account, please Sign up first.