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

optimize to split lines #1325

Merged
merged 1 commit into from
Nov 28, 2016
Merged

optimize to split lines #1325

merged 1 commit into from
Nov 28, 2016

Conversation

tagomoris
Copy link
Member

fixes #1324.

@tagomoris
Copy link
Member Author

@repeatedly Could you review this change?
Benchmark is much nice to have.

@@ -570,8 +570,8 @@ def on_notify
else
@buffer << @io.readpartial(2048, @iobuf)
end
while line = @buffer.slice!(/.*?\n/m)
@lines << line
while idx = @buffer.index("\n")
Copy link
Member

Choose a reason for hiding this comment

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

For more small optimization, "\n".freeze is better,

Copy link
Member Author

Choose a reason for hiding this comment

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

Right.

@tagomoris
Copy link
Member Author

I pushed an updated commit.

@repeatedly
Copy link
Member

Looks good to me

@tagomoris tagomoris merged commit 3444708 into master Nov 28, 2016
repeatedly pushed a commit that referenced this pull request Nov 29, 2016
@tagomoris tagomoris deleted the optimize-split-lines-in_tail branch November 30, 2016 01:54
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.

in_tail uses regexp to split lines
2 participants