Search code examples
node.jsperformancesequelize.jsapple-m1arm64

NodeJS + Sequelize extremely slow on Mac M1 Silicon


Since I use my MacBook Pro with the Apple M1 processor my express.js backend is extremely slow with Sequelize ORM.

Some Facts:

  • Executing a simple findOne takes up to 20 seconds on M1 processor. If I execute the SQL directly with DataGrip it takes about 50 ms
  • the same backend runs super fast on Intel machines with less hardware specs
  • if I execute a function without Sequelize it is also good performance on M1

Any ideas? I was searching for a solution for hours now but I can't find any topics about that problem.

Here my package.json:

"dependencies": {
    "apicache": "^1.6.3",
    "axios": "^1.3.5",
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.20.2",
    "cookie-parser": "~1.4.4",
    "cookie-session": "^1.4.0",
    "cors": "^2.8.5",
    "debug": "~4.3.4",
    "express": "~4.18.2",
    "fast-folder-size": "^1.7.0",
    "heapdump": "^0.3.15",
    "html-pdf-node": "^1.0.7",
    "http-errors": "~2.0.0",
    "jade": "~1.11.0",
    "jsonwebtoken": "^9.0.0",
    "md5": "^2.3.0",
    "moment": "^2.29.4",
    "morgan": "~1.10.0",
    "multer": "^1.4.5-lts.1",
    "mysql2": "^2.2.5",
    "node-cron": "^3.0.0",
    "nodemailer": "^6.4.16",
    "pdfmake": "^0.2.6",
    "pg": "^8.10.0",
    "pg-hstore": "^2.3.3",
    "q": "^1.5.1",
    "sequelize": "^6.30.0",
    "uuid": "^7.0.3"
  }

Solution

  • I found the problem.

    It was Sophos Home - after uninstallation everything works fine.