[ruby-core:73496] Re: [Ruby trunk - Feature #12025] [Open] Reduce minimum string buffer size from 128 to 127

From: Eric Wong <normalperson@...>
Date: 2016-01-26 22:04:09 UTC
List: ruby-core #73496
merch-redmine@jeremyevans.net wrote:
> String.buffer(100) wastes much less memory with this patch, as the
> malloc implementation can more easily deal with the power-of-2
> sized memory usage.  As measured above, memory usage is 44% less,
> and performance is 17% better.

None of jemalloc, dlmalloc 2.8.6, or glibc (dlmalloc 2.7.x-based) are
power-of-2 allocators.  I was not able to measure a difference with any
of those.

But yeah, I could see this being an improvement for power-of-2 malloc
implementations out there (OpenBSD?).  I don't think your change
would be harmful for jemalloc/dlmalloc/glibc users, either.

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next