Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert request tracker node types to numbers #9358

Closed
wants to merge 4 commits into from

Conversation

mattcompiles
Copy link
Contributor

No description provided.

@mischnic
Copy link
Member

mischnic commented Nov 3, 2023

Since all of these typeof FILE_NAME are all numbers to Flow, maybe try if using single-char strings helps with the graph size

@JakeLane
Copy link
Contributor

JakeLane commented Nov 5, 2023

Ran a quick local benchmark comparing chars and numbers:

const { serialize } = require("v8");
const { writeFile } = require("fs/promises");

const main = async () => {
  const numbers = [];
  const chars = [];

  for (let i = 0; i < 2 ** 25; i += 1) {
    numbers.push({
      type: 0,
    });
    chars.push({
      type: "0",
    });
  }

  console.log("numbers", serialize(numbers).length);
  console.log("chars", serialize(chars).length);
};

main();

Prints out:

numbers 369098765
chars 40265319

Single chars are 9.09% larger

@mattcompiles mattcompiles marked this pull request as ready for review November 6, 2023 04:17
@mattcompiles
Copy link
Contributor Author

Fixed the types but there's some issues with the integration tests still. Will look into it.

@mattcompiles
Copy link
Contributor Author

Closing in favour of #9412

@mischnic mischnic deleted the request-node-numbers branch December 2, 2023 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants