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

Redesign comment system #1952

Open
kdy1 opened this issue Jul 22, 2021 · 1 comment
Open

Redesign comment system #1952

kdy1 opened this issue Jul 22, 2021 · 1 comment

Comments

@kdy1
Copy link
Member

kdy1 commented Jul 22, 2021

It seems like a misdesign.

Problems

Convenience

API is tricky because of comments.

Performance

The current design makes fixer slow because it requires moving comments in hashmap again and again.
Moving comments involves acquiring / releasing lock and rehashing.

It can be improved using buffer, but maybe there is a fundamental problem.

cc @dsherret as you may be interested in this.

@dsherret
Copy link
Contributor

dsherret commented Aug 3, 2021

Yeah, this would be good. I also still think there are race conditions in with_leading and with_trailing where two threads might remove one after the other and one thread would end up with different comments.

fn with_leading<F, Ret>(&self, pos: BytePos, op: F) -> Ret

Edit: I have opened #2001 which fixes this race condition until the redesign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants