Skip to content

inotify: simplify bookkeeping of watched paths#543

Merged
arp242 merged 1 commit intomainfrom
watches
Jan 14, 2023
Merged

inotify: simplify bookkeeping of watched paths#543
arp242 merged 1 commit intomainfrom
watches

Conversation

@arp242
Copy link
Copy Markdown
Member

@arp242 arp242 commented Dec 20, 2022

Create a new watches type to keep track of the watches instead of keeping two maps on the Watcher and accessing these directly.

This makes the bookkeeping a bit easier to follow, and we no longer need to worry about locking map access as the watcher type takes care of that now.

Came up in #472 where I want to keep track if a path was added recursively, and this makes that a bit easier.

Also seems a bit faster:

BenchmarkWatch-2          903709              7122 ns/op             194 B/op          3 allocs/op
BenchmarkWatch-2          923980              6322 ns/op             196 B/op          3 allocs/op

Although that benchmark is very simple and only tests one code path; just want to make sure it's not a horrible regression.

@arp242 arp242 force-pushed the watches branch 3 times, most recently from 0735e7f to b5522a9 Compare December 22, 2022 08:12
Create a new watches type to keep track of the watches instead of
keeping two maps on the Watcher and accessing these directly.

This makes the bookkeeping a bit easier to follow, and we no longer need
to worry about locking map access as the watcher type takes care of that
now.

Came up in #472 where I want to keep track if a path was added
recursively, and this makes that a bit easier.

Also seems a bit faster:

	BenchmarkWatch-2          903709              7122 ns/op             194 B/op          3 allocs/op
	BenchmarkWatch-2          923980              6322 ns/op             196 B/op          3 allocs/op

Although that benchmark is very simply and only tests one code path;
just want to make sure it's not a horrible regression.
@arp242 arp242 merged commit 16df002 into main Jan 14, 2023
@arp242 arp242 deleted the watches branch January 14, 2023 17:28
arp242 added a commit that referenced this pull request Apr 27, 2024
This simplifies things quite a bit.

Previous: #543
arp242 added a commit that referenced this pull request Apr 27, 2024
This simplifies things quite a bit.

Previous: #543
arp242 added a commit that referenced this pull request Apr 27, 2024
This simplifies things quite a bit.

Previous: #543
arp242 added a commit that referenced this pull request Apr 27, 2024
This simplifies things quite a bit.

Previous: #543
arp242 added a commit that referenced this pull request Apr 27, 2024
This simplifies things quite a bit.

Previous: #543
arp242 added a commit that referenced this pull request Apr 27, 2024
This simplifies things quite a bit.

Previous: #543
arp242 added a commit that referenced this pull request Apr 27, 2024
This simplifies things quite a bit.

Previous: #543
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.

1 participant