[GH-ISSUE #172] Considerably worse performance on Windows #49

Closed
opened 2026-03-03 13:52:35 +03:00 by kerem · 5 comments
Owner

Originally created by @brianjenkins94 on GitHub (Oct 21, 2024).
Original GitHub issue: https://github.com/jehna/humanify/issues/172

This is just a casual observation that I noticed when running humanify on my Windows machine vs. my Mac, both using OpenAI as the backend.

I'll see if I can take some benchmarks, because Windows looked like it was going to take days and Mac looks like it's only going to take a couple of hours.

Originally created by @brianjenkins94 on GitHub (Oct 21, 2024). Original GitHub issue: https://github.com/jehna/humanify/issues/172 This is just a casual observation that I noticed when running humanify on my Windows machine vs. my Mac, both using OpenAI as the backend. I'll see if I can take some benchmarks, because Windows looked like it was going to take days and Mac looks like it's only going to take a couple of hours.
kerem closed this issue 2026-03-03 13:52:35 +03:00
Author
Owner

@jehna commented on GitHub (Oct 21, 2024):

Can you verify that they are using the same version?

<!-- gh-comment-id:2427320606 --> @jehna commented on GitHub (Oct 21, 2024): Can you verify that they are using the same version?
Author
Owner

@brianjenkins94 commented on GitHub (Oct 21, 2024):

I don't think this was a great test, my internet seemed like it was struggling today.

I'll run these again at some point but I don't need to be cluttering up your issue tracker.

Does humanify do multiple passes, pick up where it left off or cache anything at the moment?

M1 Pro

macOS v14.4.1
npm v10.2.4
node v20.11.1
humanifyjs v2.2.0

Input file: preact.min.js (v10.24.3)
Input command: ./hyperfine --runs 1 --show-output "npx humanifyjs openai "preact.min.js"
Processing file 1/1
Processing: 100%
Done! You can find your unminified code in output
  Time (abs ≡):        2028.960 s               [User: 7.194 s, System: 0.630 s]

Windows 10

Windows 21H2
npm v10.3.0
node v22.2.0
humanifyjs v2.2.0

Input file: preact.min.js (v10.24.3)
Input command: ./hyperfine.exe --runs 1 --show-output "npx humanifyjs openai "preact.min.js"
Processing file 1/1
Processing: 100%
Done! You can find your unminified code in output
  Time (abs ≡):        1721.797 s               [User: 6.734 s, System: 1.154 s]
<!-- gh-comment-id:2427912382 --> @brianjenkins94 commented on GitHub (Oct 21, 2024): I don't think this was a great test, my internet seemed like it was struggling today. I'll run these again at some point but I don't need to be cluttering up your issue tracker. Does humanify do multiple passes, pick up where it left off or cache anything at the moment? **M1 Pro** ``` macOS v14.4.1 npm v10.2.4 node v20.11.1 humanifyjs v2.2.0 Input file: preact.min.js (v10.24.3) Input command: ./hyperfine --runs 1 --show-output "npx humanifyjs openai "preact.min.js" Processing file 1/1 Processing: 100% Done! You can find your unminified code in output Time (abs ≡): 2028.960 s [User: 7.194 s, System: 0.630 s] ``` **Windows 10** ``` Windows 21H2 npm v10.3.0 node v22.2.0 humanifyjs v2.2.0 Input file: preact.min.js (v10.24.3) Input command: ./hyperfine.exe --runs 1 --show-output "npx humanifyjs openai "preact.min.js" Processing file 1/1 Processing: 100% Done! You can find your unminified code in output Time (abs ≡): 1721.797 s [User: 6.734 s, System: 1.154 s] ```
Author
Owner

@brianjenkins94 commented on GitHub (Oct 22, 2024):

I think maybe I just misunderstood the way it's divvying up the files or there's an element of randomness to the ordering of it.

<!-- gh-comment-id:2428052751 --> @brianjenkins94 commented on GitHub (Oct 22, 2024): I think maybe I just misunderstood the way it's divvying up the files or there's an element of randomness to the ordering of it.
Author
Owner

@0xdevalias commented on GitHub (Oct 23, 2024):

Does humanify do multiple passes, pick up where it left off or cache anything at the moment?

@brianjenkins94 To my knowledge I don't think it has any cache/etc method implemented currently.

<!-- gh-comment-id:2430848845 --> @0xdevalias commented on GitHub (Oct 23, 2024): > Does humanify do multiple passes, pick up where it left off or cache anything at the moment? @brianjenkins94 To my knowledge I don't think it has any cache/etc method implemented currently.
Author
Owner

@brianjenkins94 commented on GitHub (Oct 27, 2024):

I also noticed that this:

https://github.com/jehna/humanify/blob/main/src/plugins/webcrack.ts#L9-L20

will re-convert (and bundle?) any other files that happen to be in the output directory.

Workaround:

async function unminify(filename, outputDir, plugins = []) {
  ensureFileExists(filename);
  const bundledCode = await fs.readFile(filename, "utf-8");

+  try { await fs.rm("intermediate", { "recursive": true }); } catch (error) {}
+  await fs.mkdir("intermediate");
-  const extractedFiles = await webcrack(bundledCode, outputDir);
+  const extractedFiles = await webcrack(bundledCode, "intermediate");
<!-- gh-comment-id:2440112324 --> @brianjenkins94 commented on GitHub (Oct 27, 2024): I also noticed that this: https://github.com/jehna/humanify/blob/main/src/plugins/webcrack.ts#L9-L20 will re-convert (and bundle?) any other files that happen to be in the `output` directory. Workaround: ```diff async function unminify(filename, outputDir, plugins = []) { ensureFileExists(filename); const bundledCode = await fs.readFile(filename, "utf-8"); + try { await fs.rm("intermediate", { "recursive": true }); } catch (error) {} + await fs.mkdir("intermediate"); - const extractedFiles = await webcrack(bundledCode, outputDir); + const extractedFiles = await webcrack(bundledCode, "intermediate"); ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/humanify#49
No description provided.