Skip to content

DirectoryWatcher optimisation#1365

Open
9il wants to merge 3 commits intovibe-d:masterfrom
9il:dw
Open

DirectoryWatcher optimisation#1365
9il wants to merge 3 commits intovibe-d:masterfrom
9il:dw

Conversation

@9il
Copy link
Copy Markdown
Contributor

@9il 9il commented Jan 6, 2016

No description provided.

Comment thread source/vibe/core/file.d
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref was replaced with out, because previous implementations contain dst.length = 0;

@s-ludwig
Copy link
Copy Markdown
Member

s-ludwig commented Jan 7, 2016

I don't remember how exactly the current API and semantics resulted, but I think we should go for an interface that can work without allocations. An obvious way to do this for the existing API would be to add a call to dst.assumeSafeAppend(); after the dst.length = 0;. More precise semantics would only overwrite dst up the its original length.

For a new API I'd either go straight with a range based interface (would have to use a range object), or simply use a scoped callback that accepts each change - probably the latter because it usually means less boilerplate code. The Appender solution can then be implemented on top of that.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants