From 77eca9153057cb0aa70e1769fb2f20642f56a226 Mon Sep 17 00:00:00 2001 From: acuciureanu Date: Tue, 16 Jan 2024 22:38:16 +0200 Subject: [PATCH] perf(check.service.js): optimize memory usage and performance in prototype pollution script Refactored the ppfang script to enhance memory efficiency and performance. Implemented lazy evaluation for property difference calculations and optimized iframe usage by introducing a reusable clean window context. This update minimizes the memory footprint and improves the execution speed, especially in scenarios where the script is run multiple times. --- services/check.service.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/check.service.js b/services/check.service.js index ec15320..ece2918 100644 --- a/services/check.service.js +++ b/services/check.service.js @@ -27,7 +27,9 @@ const probeAll = async (urls, concurrency = 10) => { try { const { results } = await PromisePool.for(urls) .withConcurrency(concurrency) - .onTaskFinished((url, pool) => console.log(`[${pool.processedPercentage().toFixed(2)}%] Processed ${url} ...`)) + .onTaskFinished((url, pool) => + console.log(`[${pool.processedPercentage().toFixed(2)}%] Processed ${url} ...`) + ) .process(async (url) => { const page = pages.length > 0 ? pages.shift() : await browser.newPage(); const result = await probe(url, page);