Skip to content

Conversation

@phraktle
Copy link
Contributor

The library creates an excessive amount of garbage. To address this, a thorough redesign would be needed (see issue #13). In the meantime, here's a small patch that reduces allocations around Decoder#decodeString, incidentally also improving performance by 10-20%.

Yields ~10% improvement in included Benchmark.
Avoids ThreadLocal lookups in Charset#decode, another ~5% improvement
on Benchmark.
@oschwald
Copy link
Member

Thanks! These seem reasonable. I get about a 10% improvement with them.

oschwald added a commit that referenced this pull request Dec 14, 2015
Optimizations for String decoding
@oschwald oschwald merged commit f8c4536 into maxmind:master Dec 14, 2015
@phraktle phraktle deleted the perf-opt branch December 14, 2015 00:15
oschwald added a commit that referenced this pull request Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants