Laravel:为什么数据库播种机在我的快速电脑上这么慢

I'm running a typical Laravel version 5.2.23 on Homestead Vagrant box on Win10 with a fast NVMe ssd, Skylake i7 6700K cpu, 16GB ram. VirtualBox 5.0.26 r108824. I have 4GB and 2 CPU's allocated to the VM. Pretty much everything is default.

This very basic user table seeder takes 45 seconds for 1000 records and I had faster performance with a much slower pc before with Laravel 4.2. When I hit the localhost site it loads fast with data ( I simply echo the entire 1000 record user table in index.html ) so it doesn't seem like a network traffic slowdown between the VM and Win10, but idk.

Seeder is below.

class UsersTableSeeder extends Seeder {

public function run() {
    DB::table('users')->truncate();

    for( $ii = 0; $ii < 1000; $ii++)
    DB::table('users')->insert([
        'name' => $ii,
        'email' => $ii.'@gmail.com',
        'password' => bcrypt('secret'),
    ]);


}

}

I know sometimes there can be weird Windows file system slowdowns with Linux based VM's, but I'm not sure whats going on here. Any help would be great.

Because bcrypt function call is slow. Usually it takes around 50ms for one operation(depending on machine it can be faster). (50ms * 1000op) / 1000ms = 50s.

See more Why is php's password_hash so slow?