Skip to content

Avoid to flush an extra buffer when the string isn't too large in Mes…#293

Merged
xerial merged 3 commits intov07-developfrom
issue_292
Nov 17, 2015
Merged

Avoid to flush an extra buffer when the string isn't too large in Mes…#293
xerial merged 3 commits intov07-developfrom
issue_292

Conversation

@komamitsu
Copy link
Copy Markdown
Member

…sagePack#packString

Fix #292

@komamitsu
Copy link
Copy Markdown
Member Author

@xerial Can you review this pull request? This won't completely resolve #292 because it works only when the string is not so large. But it works in most cases and mitigates this problem.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This involves a look up of the character encoding type table. Use MessagePack.UTF8

@xerial
Copy link
Copy Markdown
Member

xerial commented Nov 15, 2015

According to https://blogs.oracle.com/xuemingshen/entry/faster_new_string_bytes_cs, JVM improved the performance of String.getBytes for small strings. So this optimization makes sense.

@komamitsu
Copy link
Copy Markdown
Member Author

Thanks for the comments. I'll address them tomorrow.

@komamitsu
Copy link
Copy Markdown
Member Author

@xerial Updated!

xerial added a commit that referenced this pull request Nov 17, 2015
Avoid to flush an extra buffer when the string isn't too large in Mes…
@xerial xerial merged commit 5e989d9 into v07-develop Nov 17, 2015
@xerial
Copy link
Copy Markdown
Member

xerial commented Nov 17, 2015

Merged. Thanks!

@komamitsu komamitsu deleted the issue_292 branch December 25, 2015 06:44
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.

2 participants