Răsfoiți Sursa

[HyperExpress] Update Version 6.8.5 (#8395)

* [HyperExpress] Bump version 6.8.3

* [HyperExpress] Bump version 6.8.5
Imam Fahrur Rofi 1 an în urmă
părinte
comite
4669209e73

+ 2 - 2
frameworks/JavaScript/hyperexpress/benchmark_config.json

@@ -39,7 +39,7 @@
         "webserver": "µws",
         "os": "Linux",
         "database_os": "Linux",
-        "display_name": "hyperexpress",
+        "display_name": "hyperexpress-postgres",
         "notes": "",
         "versus": "nodejs"
       },
@@ -61,7 +61,7 @@
         "webserver": "µws",
         "os": "Linux",
         "database_os": "Linux",
-        "display_name": "hyperexpress",
+        "display_name": "hyperexpress-mysql",
         "notes": "",
         "versus": "nodejs"
       }

+ 2 - 4
frameworks/JavaScript/hyperexpress/database/mysql.js

@@ -2,7 +2,7 @@ import { createPool } from 'mariadb'
 import { cpus } from 'node:os'
 import { clientOpts } from '../config.js'
 
-const pool = createPool({ ...clientOpts, connectionLimit: cpus().length * 2 + 1 })
+const pool = createPool({ ...clientOpts, connectionLimit: cpus().length })
 
 const execute = (text, values) => pool.execute(text, values || undefined)
 
@@ -12,6 +12,4 @@ export const find = (id) => execute('SELECT id, randomNumber FROM world WHERE id
 
 export const getAllWorlds = () => execute('SELECT id, randomNumber FROM world')
 
-export const update = (obj) => execute('UPDATE world SET randomNumber = ? WHERE id = ?', [obj.randomNumber, obj.id])
-
-export const bulkUpdate = (worlds) => Promise.all(worlds.map(world => update(world)))
+export const bulkUpdate = (worlds) => pool.batch('UPDATE world SET randomNumber = ? WHERE id = ?', worlds.map(world => [world.randomNumber, world.id]).sort((a, b) => (a[1] < b[1]) ? -1 : 1))

+ 3 - 3
frameworks/JavaScript/hyperexpress/hyperexpress-mysql.dockerfile

@@ -1,5 +1,5 @@
 # syntax=docker/dockerfile:1
-FROM node:18-slim
+FROM node:20-slim
 
 WORKDIR /app
 
@@ -7,10 +7,10 @@ COPY --chown=node:node . .
 
 ENV NODE_ENV production
 
-ENV DATABASE mysql
-
 RUN npm install
 
+ENV DATABASE mysql
+
 USER node
 
 EXPOSE 8080

+ 3 - 3
frameworks/JavaScript/hyperexpress/hyperexpress-postgres.dockerfile

@@ -1,5 +1,5 @@
 # syntax=docker/dockerfile:1
-FROM node:18-slim
+FROM node:20-slim
 
 WORKDIR /app
 
@@ -7,10 +7,10 @@ COPY --chown=node:node . .
 
 ENV NODE_ENV production
 
-ENV DATABASE postgres
-
 RUN npm install
 
+ENV DATABASE postgres
+
 USER node
 
 EXPOSE 8080

+ 1 - 1
frameworks/JavaScript/hyperexpress/hyperexpress.dockerfile

@@ -1,5 +1,5 @@
 # syntax=docker/dockerfile:1
-FROM node:18-slim
+FROM node:20-slim
 
 WORKDIR /app
 

+ 14 - 14
frameworks/JavaScript/hyperexpress/package-lock.json

@@ -9,8 +9,8 @@
       "version": "0.0.1",
       "license": "MIT",
       "dependencies": {
-        "hyper-express": "^6.8.1",
-        "lru-cache": "^10.0.0",
+        "hyper-express": "^6.8.5",
+        "lru-cache": "^10.0.1",
         "mariadb": "^3.2.0",
         "postgres": "^3.3.5"
       }
@@ -159,9 +159,9 @@
       }
     },
     "node_modules/hyper-express": {
-      "version": "6.8.1",
-      "resolved": "https://registry.npmjs.org/hyper-express/-/hyper-express-6.8.1.tgz",
-      "integrity": "sha512-HzIVPK4DzI75VuK/TR9yZVNWMyauEQQgElbL2ci2rL0DrTLuKh7qAe1BfeqsbxaH/e99setP3YGMhwjOMf/sgA==",
+      "version": "6.8.5",
+      "resolved": "https://registry.npmjs.org/hyper-express/-/hyper-express-6.8.5.tgz",
+      "integrity": "sha512-tlHCGg0xKRHRheqY3Fgb8FvuvluCqIf6tJXiiyadsQh108g/givMqKt0XBYV+Rw0vstmmROuJ3cHXiUkQoddgg==",
       "dependencies": {
         "@types/busboy": "^0.3.1",
         "@types/express": "^4.17.13",
@@ -189,9 +189,9 @@
       }
     },
     "node_modules/lru-cache": {
-      "version": "10.0.0",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz",
-      "integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==",
+      "version": "10.0.1",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz",
+      "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==",
       "engines": {
         "node": "14 || >=16.14"
       }
@@ -459,9 +459,9 @@
       "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw=="
     },
     "hyper-express": {
-      "version": "6.8.1",
-      "resolved": "https://registry.npmjs.org/hyper-express/-/hyper-express-6.8.1.tgz",
-      "integrity": "sha512-HzIVPK4DzI75VuK/TR9yZVNWMyauEQQgElbL2ci2rL0DrTLuKh7qAe1BfeqsbxaH/e99setP3YGMhwjOMf/sgA==",
+      "version": "6.8.5",
+      "resolved": "https://registry.npmjs.org/hyper-express/-/hyper-express-6.8.5.tgz",
+      "integrity": "sha512-tlHCGg0xKRHRheqY3Fgb8FvuvluCqIf6tJXiiyadsQh108g/givMqKt0XBYV+Rw0vstmmROuJ3cHXiUkQoddgg==",
       "requires": {
         "@types/busboy": "^0.3.1",
         "@types/express": "^4.17.13",
@@ -486,9 +486,9 @@
       }
     },
     "lru-cache": {
-      "version": "10.0.0",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz",
-      "integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw=="
+      "version": "10.0.1",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz",
+      "integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g=="
     },
     "mariadb": {
       "version": "3.2.0",

+ 2 - 2
frameworks/JavaScript/hyperexpress/package.json

@@ -8,8 +8,8 @@
   "author": "",
   "license": "MIT",
   "dependencies": {
-    "hyper-express": "^6.8.1",
-    "lru-cache": "^10.0.0",
+    "hyper-express": "^6.8.5",
+    "lru-cache": "^10.0.1",
     "mariadb": "^3.2.0",
     "postgres": "^3.3.5"
   },