harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Berezhniuk" <ilya.berezhn...@gmail.com>
Subject [drlvm][performance] VM properties implementation is inefficient
Date Thu, 10 May 2007 16:51:13 GMT
Hi all,

During VM debugging, I've recently discovered strange behavior of VM
properties. When somebody requests for VM property, the value of property is
copied with strdup(), and then freed with free() in Properties::destroy().
In addition to such excessive copying, property hash contains PropValue
structure pointer instead of string (the only data in this structure
contains is 'char* value'), it's another redundant allocation/deallocation.
Copied property value is mostly used as 'const char*' - I've found only 4
places when it's modified.

I've supposed that it's a little bottleneck, and tried to eliminate
redundant heap access. I also supposed that copying was required to be sure
that value will not be destroyed when another thread changes property value.
So I've replaced PropValue* with String* values allocated in VM string pool:
loader_env->string_pool.
In few places where obtained property value was modified, I've inserted
value copying.

With this modifications, I've reached performance gain (measured with
SPECjbb2005) 2.16% for default mode and 2.41% for server mode.
I've submitted patch to H-3836 [1].

This patch contains a lot of modifications in 'vmcore' module, and several
small modifications in components like EM, GC, Jitrino, but I'm not familiar
with these components.
Could VM gurus and component owners check this patch for completeness and
consistency?
And could anybody take this JIRA and commit if all is OK?


[1]
http://issues.apache.org/jira/browse/HARMONY-3836

-- 

Ilya

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message