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

feat(back): #1101 globbed attrs #1102

Merged
merged 1 commit into from
Jun 5, 2023
Merged

feat(back): #1101 globbed attrs #1102

merged 1 commit into from
Jun 5, 2023

Conversation

dsalaza4
Copy link
Contributor

@dsalaza4 dsalaza4 commented Jun 2, 2023

  • Collect attr paths using python globs for initialization performance
  • Pass them as attrPaths to evaluator
  • Redefine evaluator logic for building outputs from attrs
  • Initialization for universe takes less than 3 seconds now

@dsalaza4
Copy link
Contributor Author

dsalaza4 commented Jun 2, 2023

@kamadorueda Any architectural comments regarding this?

@dsalaza4
Copy link
Contributor Author

dsalaza4 commented Jun 3, 2023

Instead of concatenating them, I will dump all paths into a json string and then parse them in nix. I don't want to use files to avoid IO

@kamadorueda
Copy link
Contributor

@kamadorueda Any architectural comments regarding this?

Not really, I understand the reason for the change. One failure mode to be aware of is that the OS restricts the length of command (between 32kB to 2MB depending on the OS). But at that point, we can switch to a file

Another way to optimize with a more aggressive trade-off is using the fact that people use the build system more often than they modify the build system: so we could add a "generate manifests" step after modifications that produces the list of commands (and everything else needed for the CLI), and which gets versioned in the repo. This way the CLI can consume a "manifest" or "lock" file that already contains the list of outputs, instead of computing it every time. It adds one step to modifications, but saves one step for the average user and also enables faster command auto-completion (as stuff is always ready to consume). The other option is making consumers "initialize the project": Something like "makes install", where before using the project you need to install it, and in this installation step we generate some manifests for the CLI that are reused on all future invocations

in general, if this PR makes it fast enough, I think that's good enough

- Collect attr paths using python globs
for initialization performance
- Pass them as attrPaths to evaluator
- Redefine evaluator logic for building outputs from attrs
- Initialization for universe takes 1 second now

Signed-off-by: Daniel Salazar <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@jpverde jpverde merged commit fc31801 into fluidattacks:main Jun 5, 2023
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