From 1ea8f8b4feb6b730ead113e5db86010678304b22 Mon Sep 17 00:00:00 2001 From: Namekuji Date: Thu, 6 Jul 2023 17:22:15 -0400 Subject: [PATCH] perf: use msgpackr to encode and decode --- packages/backend/package.json | 4 ++-- packages/backend/src/misc/cache.ts | 2 +- pnpm-lock.yaml | 11 +++-------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index 060064489..ec6451f61 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -28,13 +28,11 @@ "@bull-board/api": "5.2.0", "@bull-board/koa": "5.2.0", "@bull-board/ui": "5.2.0", - "megalodon": "workspace:*", "@discordapp/twemoji": "14.1.2", "@elastic/elasticsearch": "7.17.0", "@koa/cors": "3.4.3", "@koa/multer": "3.0.2", "@koa/router": "9.0.1", - "@msgpack/msgpack": "3.0.0-beta2", "@peertube/http-signature": "1.7.0", "@redocly/openapi-core": "1.0.0-beta.120", "@sinonjs/fake-timers": "9.1.2", @@ -87,9 +85,11 @@ "koa-send": "5.0.1", "koa-slow": "2.1.0", "koa-views": "7.0.2", + "megalodon": "workspace:*", "meilisearch": "0.33.0", "mfm-js": "0.23.3", "mime-types": "2.1.35", + "msgpackr": "1.9.5", "multer": "1.4.4-lts.1", "native-utils": "link:native-utils", "nested-property": "4.0.0", diff --git a/packages/backend/src/misc/cache.ts b/packages/backend/src/misc/cache.ts index fe68908e5..913258f05 100644 --- a/packages/backend/src/misc/cache.ts +++ b/packages/backend/src/misc/cache.ts @@ -1,5 +1,5 @@ import { redisClient } from "@/db/redis.js"; -import { encode, decode } from "@msgpack/msgpack"; +import { encode, decode } from "msgpackr"; import { ChainableCommander } from "ioredis"; export class Cache { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3fc168cf1..b9522c434 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -105,9 +105,6 @@ importers: '@koa/router': specifier: 9.0.1 version: 9.0.1 - '@msgpack/msgpack': - specifier: 3.0.0-beta2 - version: 3.0.0-beta2 '@peertube/http-signature': specifier: 1.7.0 version: 1.7.0 @@ -276,6 +273,9 @@ importers: mime-types: specifier: 2.1.35 version: 2.1.35 + msgpackr: + specifier: 1.9.5 + version: 1.9.5 multer: specifier: 1.4.4-lts.1 version: 1.4.4-lts.1 @@ -2607,11 +2607,6 @@ packages: os-filter-obj: 2.0.0 dev: true - /@msgpack/msgpack@3.0.0-beta2: - resolution: {integrity: sha512-y+l1PNV0XDyY8sM3YtuMLK5vE3/hkfId+Do8pLo/OPxfxuFAUwcGz3oiiUuV46/aBpwTzZ+mRWVMtlSKbradhw==} - engines: {node: '>= 14'} - dev: false - /@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.2: resolution: {integrity: sha512-9bfjwDxIDWmmOKusUcqdS4Rw+SETlp9Dy39Xui9BEGEk19dDwH0jhipwFzEff/pFg95NKymc6TOTbRKcWeRqyQ==} cpu: [arm64]