-
Notifications
You must be signed in to change notification settings - Fork 717
Reorganize fileLoader, make it lock-free via SyncMaps #779
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
internal/compiler/program.go:154
- The code still references p.files after the change to use p.processedFiles. Update the iteration to use p.processedFiles.files.
for _, file := range p.files {
This reverts commit 78deec5.
Bug in the lint rule, nice. EDIT: I can't fix it without golang/go#73278 or a bunch of finagling to fix up the CFG, so I'll just rename the var to make the lint rule happy. |
This reverts commit 37b9053.
Realized that none of this even needs to be locked; we can just put the info onto the tasks, which we collect later anyway. |
I'm currently modifying this to work on JSX stuff; sending this refactor in early.
I'm going to add more stuff to the file loader for JSX, so converting its return into a struct will make a future PR simpler.
Additionally, there's no real need to use full locks here; sync maps are sufficient for all uses, so we can do everything in the loader lock-free (more or less).Actually, we don't need any locks or sync maps at all outside the one used to dedupe tasks.