From 40d70ef136df9ed13338271ad38776e9abdbd5ce Mon Sep 17 00:00:00 2001 From: Juan M Date: Sat, 27 Jan 2024 08:49:04 -0300 Subject: [PATCH 1/2] Remove performance --- examples/drops/backend/package.json | 1 - examples/drops/backend/src/index.ts | 13 +++--------- examples/moments/backend/package.json | 1 - examples/moments/backend/src/index.ts | 18 ++++------------ examples/poaps/backend/package.json | 1 - examples/poaps/backend/src/index.ts | 30 +++++++-------------------- package-order.sh | 1 - packages/performance/package.json | 28 ------------------------- packages/performance/rollup.config.js | 3 --- packages/performance/src/index.ts | 11 ---------- packages/performance/tsconfig.json | 9 -------- yarn.lock | 9 -------- 12 files changed, 14 insertions(+), 111 deletions(-) delete mode 100644 packages/performance/package.json delete mode 100644 packages/performance/rollup.config.js delete mode 100644 packages/performance/src/index.ts delete mode 100644 packages/performance/tsconfig.json diff --git a/examples/drops/backend/package.json b/examples/drops/backend/package.json index 5441703d..80902717 100644 --- a/examples/drops/backend/package.json +++ b/examples/drops/backend/package.json @@ -19,7 +19,6 @@ "stream": "^0.0.2" }, "devDependencies": { - "@poap-xyz/performance": "*", "@types/node-fetch": "^2.6.3", "ts-node": "^10.4.0", "typescript": "^4.5.5" diff --git a/examples/drops/backend/src/index.ts b/examples/drops/backend/src/index.ts index b24d0749..724040e7 100644 --- a/examples/drops/backend/src/index.ts +++ b/examples/drops/backend/src/index.ts @@ -1,4 +1,3 @@ -import { measurePerformance } from '@poap-xyz/performance'; import { DropsClient } from '@poap-xyz/drops'; import { PoapCompass, PoapDropApi } from '@poap-xyz/providers'; import { fetch_multiple_drops } from './methods/fetch_multiple_drops'; @@ -20,17 +19,11 @@ async function main(): Promise { }), ); // Multiple Drops - await measurePerformance( - () => fetch_multiple_drops(client), - 'fetch_multiple_drops', - ); + await fetch_multiple_drops(client); // One Drop by id - await measurePerformance( - () => fetch_single_drop(client), - 'fetch_single_drop', - ); + await fetch_single_drop(client); // Create Drop - await measurePerformance(() => create_drop(client), 'create_drop'); + await create_drop(client); } main().catch((error) => { diff --git a/examples/moments/backend/package.json b/examples/moments/backend/package.json index 8dac43bf..e6131833 100644 --- a/examples/moments/backend/package.json +++ b/examples/moments/backend/package.json @@ -19,7 +19,6 @@ "node-fetch": "^3.3.1" }, "devDependencies": { - "@poap-xyz/performance": "*", "@types/mime": "^3.0.1", "@types/node": "^18.16.0", "@types/node-fetch": "^2.6.3", diff --git a/examples/moments/backend/src/index.ts b/examples/moments/backend/src/index.ts index 7864d579..58b344dd 100644 --- a/examples/moments/backend/src/index.ts +++ b/examples/moments/backend/src/index.ts @@ -1,4 +1,3 @@ -import { measurePerformance } from '@poap-xyz/performance'; import { MomentsClient } from '@poap-xyz/moments'; import { PoapCompass, @@ -30,22 +29,13 @@ async function main(): Promise { const client = new MomentsClient(momentsApi, compass); // Create Moment - await measurePerformance(() => create_moment(client), 'create_moment'); + await create_moment(client); // Fetch multiple moments - await measurePerformance( - () => fetch_multiple_moments(client), - 'fetch_multiple_moments', - ); + await fetch_multiple_moments(client); // Fetch one moment by id - await measurePerformance( - () => fetch_single_moment(client), - 'fetch_single_moment', - ); + await fetch_single_moment(client); // Fetch moments by drop ids - await measurePerformance( - () => fetch_moments_by_drop_ids(client), - 'fetch_moments_by_drop_ids', - ); + await fetch_moments_by_drop_ids(client); } main().catch(() => { diff --git a/examples/poaps/backend/package.json b/examples/poaps/backend/package.json index 945824ac..7ccb5637 100644 --- a/examples/poaps/backend/package.json +++ b/examples/poaps/backend/package.json @@ -20,7 +20,6 @@ "stream": "^0.0.2" }, "devDependencies": { - "@poap-xyz/performance": "*", "ts-node": "^10.4.0", "typescript": "^4.5.5" } diff --git a/examples/poaps/backend/src/index.ts b/examples/poaps/backend/src/index.ts index 779dbf8b..2810af0b 100644 --- a/examples/poaps/backend/src/index.ts +++ b/examples/poaps/backend/src/index.ts @@ -1,4 +1,3 @@ -import { measurePerformance } from '@poap-xyz/performance'; import { PoapsClient } from '@poap-xyz/poaps'; import { AuthenticationProviderHttp, @@ -34,34 +33,19 @@ async function main(): Promise { }), ); // Multiple POAPs - await measurePerformance( - () => fetch_multiple_poaps(client), - 'fetch_multiple_poaps', - ); + await fetch_multiple_poaps(client); // One POAP by id - await measurePerformance( - () => fetch_single_poap(client), - 'fetch_single_poap', - ); + await fetch_single_poap(client); // Multiple POAPs by collector - await measurePerformance( - () => fetch_multiple_poaps_by_collector(client), - 'fetch_multiple_poaps_by_collector', - ); + await fetch_multiple_poaps_by_collector(client); // Multiple POAPs by drop - await measurePerformance( - () => fetch_multiple_poaps_by_drop_id(client), - 'fetch_multiple_poaps_by_drop_id', - ); + await fetch_multiple_poaps_by_drop_id(client); // mint Sync POAP - await measurePerformance(() => mint_sync_poap(client), 'mint_sync_poap'); + await mint_sync_poap(client); // mint Async POAP - await measurePerformance(() => mint_async_poap(client), 'mint_async_poap'); + await mint_async_poap(client); // Email Reservation POAP - await measurePerformance( - () => email_reservation_poap(client), - 'email_reservation_poap', - ); + await email_reservation_poap(client); } main().catch((error) => { diff --git a/package-order.sh b/package-order.sh index 0fa9bc96..30b2e38b 100644 --- a/package-order.sh +++ b/package-order.sh @@ -6,6 +6,5 @@ DIRS=( "packages/providers" "packages/drops" "packages/poaps" - "packages/performance" "packages/moments" ) diff --git a/packages/performance/package.json b/packages/performance/package.json deleted file mode 100644 index aa6618b3..00000000 --- a/packages/performance/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@poap-xyz/performance", - "version": "0.1.1", - "description": "Performance module for the poap.js library", - "type": "module", - "main": "dist/cjs/index.cjs", - "module": "dist/esm/index.mjs", - "typings": "dist/cjs/index.d.ts", - "browser": "dist/umd/index.js", - "exports": { - "require": "./dist/cjs/index.cjs", - "import": "./dist/esm/index.mjs", - "browser": "./dist/umd/index.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/poap-xyz/poap.js.git" - }, - "author": "POAP", - "license": "MIT", - "bugs": { - "url": "https://github.com/poap-xyz/poap.js/issues" - }, - "homepage": "https://github.com/poap-xyz/poap.js#readme", - "scripts": { - "build": "rollup -c --bundleConfigAsCjs" - } -} diff --git a/packages/performance/rollup.config.js b/packages/performance/rollup.config.js deleted file mode 100644 index 5c310463..00000000 --- a/packages/performance/rollup.config.js +++ /dev/null @@ -1,3 +0,0 @@ -import configs from '../../rollup.base.config'; - -export default configs; diff --git a/packages/performance/src/index.ts b/packages/performance/src/index.ts deleted file mode 100644 index 88442367..00000000 --- a/packages/performance/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { performance } from 'perf_hooks'; - -export async function measurePerformance( - fn: () => Promise, - name: string, -): Promise { - const start = performance.now(); - await fn(); - const end = performance.now(); - console.log(`${name} took ${end - start} milliseconds to execute.`); -} diff --git a/packages/performance/tsconfig.json b/packages/performance/tsconfig.json deleted file mode 100644 index 7dce305c..00000000 --- a/packages/performance/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "./src", - "composite": true - }, - "include": ["./src/**/*.ts"] -} diff --git a/yarn.lock b/yarn.lock index f909a9d9..6793e217 100644 --- a/yarn.lock +++ b/yarn.lock @@ -893,12 +893,6 @@ __metadata: languageName: unknown linkType: soft -"@poap-xyz/performance@*, @poap-xyz/performance@workspace:packages/performance": - version: 0.0.0-use.local - resolution: "@poap-xyz/performance@workspace:packages/performance" - languageName: unknown - linkType: soft - "@poap-xyz/poaps@*, @poap-xyz/poaps@workspace:packages/poaps": version: 0.0.0-use.local resolution: "@poap-xyz/poaps@workspace:packages/poaps" @@ -1806,7 +1800,6 @@ __metadata: resolution: "backend-drops-example@workspace:examples/drops/backend" dependencies: "@poap-xyz/drops": "*" - "@poap-xyz/performance": "*" "@poap-xyz/providers": "*" "@poap-xyz/utils": "*" "@types/node": ^18.16.0 @@ -1825,7 +1818,6 @@ __metadata: resolution: "backend-moments-example@workspace:examples/moments/backend" dependencies: "@poap-xyz/moments": "*" - "@poap-xyz/performance": "*" "@poap-xyz/providers": "*" "@poap-xyz/utils": "*" "@types/mime": ^3.0.1 @@ -1845,7 +1837,6 @@ __metadata: version: 0.0.0-use.local resolution: "backend-poaps-example@workspace:examples/poaps/backend" dependencies: - "@poap-xyz/performance": "*" "@poap-xyz/poaps": "*" "@poap-xyz/providers": "*" "@poap-xyz/utils": "*" From 7518c96cb86930e7db98d4eb384985638fb2e72f Mon Sep 17 00:00:00 2001 From: Juan M Date: Sat, 27 Jan 2024 08:51:49 -0300 Subject: [PATCH 2/2] Add weird place to find perfomance package --- .yarn/versions/f03c9fda.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.yarn/versions/f03c9fda.yml b/.yarn/versions/f03c9fda.yml index a17c06cd..414011ad 100644 --- a/.yarn/versions/f03c9fda.yml +++ b/.yarn/versions/f03c9fda.yml @@ -2,6 +2,5 @@ undecided: - poap.js - "@poap-xyz/drops" - "@poap-xyz/moments" - - "@poap-xyz/performance" - "@poap-xyz/poaps" - "@poap-xyz/providers"