[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Patch: use StringBuilder for reading/writing property f
From: |
Anthony Green |
Subject: |
Re: [cp-patches] Patch: use StringBuilder for reading/writing property files |
Date: |
Thu, 20 Oct 2005 22:18:06 -0700 |
On Wed, 2005-10-19 at 14:53 -0700, Anthony Green wrote:
> On Wed, 2005-10-19 at 12:49 -0700, David Daney wrote:
> > You also might want to look at comment #1 of:
> >
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21869
>
> Thanks for the pointer. I think a non-copying unsynchronized
> StringBuffer clearly makes the most sense. I'll demonstrate the
> improvement with gcj before my next patch.
I patched the FC rawhide GCC to use gnu.gcj.runtime.StringBuffer in
java.util.Properties, and wrote a little program to read the locale
property files from GNU Classpath. Reading the property files was
about 10% faster.
Here's oprofile output from before and after. Note how _Jv_MonitorEnter
and _Jv_MonitorExit migrate down the list.
Adding this kind of unsynchronized StringBuffer to GNU Classpath seems
like a good idea. (although I don't plan on doing that soon)
CPU: P4 / Xeon, speed 2400 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped)
with a unit mask of 0x01 (mandatory) count 100000
samples % image name app name symbol name
1842 8.6268 libgcj.so.6.0.0 libgcj.so.6.0.0
_Jv_MonitorExit
1448 6.7816 libgcj.so.6.0.0 libgcj.so.6.0.0
_Jv_MonitorEnter
840 3.9341 libgcj.so.6.0.0 libgcj.so.6.0.0 GC_mark_from
329 1.5408 libgcj.so.6.0.0 libgcj.so.6.0.0
GC_malloc_atomic
319 1.4940 libgcj.so.6.0.0 libgcj.so.6.0.0
java::util::Properties::load(java::io::InputStream*)
226 1.0584 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::StringBuffer::append(wchar_t)
200 0.9367 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::String::charAt(int)
175 0.8196 libgcj.so.6.0.0 libgcj.so.6.0.0
GC_gcj_malloc
172 0.8055 libgcj.so.6.0.0 libgcj.so.6.0.0
__i686.get_pc_thunk.bx
172 0.8055 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::Character::isWhitespace(wchar_t)
150 0.7025 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::Integer::parseInt(java::lang::String*, int, bool)
136 0.6369 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::StringBuffer::ensureCapacity_unsynchronized(int)
132 0.6182 libgcj.so.6.0.0 libgcj.so.6.0.0 .plt
119 0.5573 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::Character::readChar(wchar_t)
102 0.4777 libgcj.so.6.0.0 libgcj.so.6.0.0
gnu::gcj::convert::Input_8859_1::read(JArray<wchar_t>*, int, int)
102 0.4777 libgcj.so.6.0.0 libgcj.so.6.0.0
java::util::Hashtable::put(java::lang::Object*, java::lang::Object*)
101 0.4730 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::String::equals(java::lang::Object*)
74 0.3466 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::Object::getClass()
73 0.3419 libgcj.so.6.0.0 libgcj.so.6.0.0
java::io::BufferedReader::lineEnd(int)
72 0.3372 libgcj.so.6.0.0 libgcj.so.6.0.0
_Jv_InitClass
CPU: P4 / Xeon, speed 2400 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped)
with a unit mask of 0x01 (mandatory) count 100000
samples % image name app name symbol name
2151 11.0836 libgcj.so.6.0.0 libgcj.so.6.0.0 GC_mark_from
869 4.4778 libgcj.so.6.0.0 libgcj.so.6.0.0
GC_add_to_black_list_normal
411 2.1178 libgcj.so.6.0.0 libgcj.so.6.0.0
java::util::Properties::load(java::io::InputStream*)
390 2.0096 libgcj.so.6.0.0 libgcj.so.6.0.0
gnu::gcj::runtime::StringBuffer::ensureCapacity(int)
359 1.8498 libgcj.so.6.0.0 libgcj.so.6.0.0
GC_find_start
301 1.5510 libgcj.so.6.0.0 libgcj.so.6.0.0
GC_malloc_atomic
249 1.2830 libgcj.so.6.0.0 libgcj.so.6.0.0
__i686.get_pc_thunk.bx
233 1.2006 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::String::charAt(int)
210 1.0821 libgcj.so.6.0.0 libgcj.so.6.0.0
GC_gcj_malloc
199 1.0254 libgcj.so.6.0.0 libgcj.so.6.0.0 .plt
172 0.8863 libgcj.so.6.0.0 libgcj.so.6.0.0
gnu::gcj::runtime::StringBuffer::append(wchar_t)
167 0.8605 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::Integer::parseInt(java::lang::String*, int, bool)
165 0.8502 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::Character::isWhitespace(wchar_t)
127 0.6544 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::Character::readChar(wchar_t)
113 0.5823 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::Character::digit(wchar_t, int)
101 0.5204 libgcj.so.6.0.0 libgcj.so.6.0.0
java::lang::String::equals(java::lang::Object*)
97 0.4998 libgcj.so.6.0.0 libgcj.so.6.0.0
gnu::gcj::convert::Input_8859_1::read(JArray<wchar_t>*, int, int)
93 0.4792 libgcj.so.6.0.0 libgcj.so.6.0.0
_Jv_MonitorExit
93 0.4792 libgcj.so.6.0.0 libgcj.so.6.0.0
java::io::BufferedReader::lineEnd(int)
71 0.3658 libgcj.so.6.0.0 libgcj.so.6.0.0
_Jv_MonitorEnter
Re: [cp-patches] Patch: use StringBuilder for reading/writing property files, Andrew John Hughes, 2005/10/26