aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2009-12-21 10:52:53 -0800
committerElliott Hughes <enh@google.com>2009-12-21 15:02:47 -0800
commitcb1732a4f9abeddce24b1efa3eaab8e6acf47be8 (patch)
treece8f50d5e07d8b9a8563c7466de6f27473e28228 /vm/compiler/codegen
parentb78a6ce57026778f0274f2a35da8eb3bce0ad5f9 (diff)
Speed up the way we access ICU's locale data.
This patch makes creating a new NumberFormat or new SimpleDateFormat 2x faster. Basically, the ResourceBundle mechanism is really expensive in several ways: 1. The two-level caching is unnecessary for locale data, and expensive because it burns through a lot of temporary objects. 2. The PrivilegedAction stuff is unnecessary and expensive because it too burns quite a few temporary objects (including an ArrayList for each call; should we consider removing support for SecurityManager so we can remove this cruft from our code?). 3. The caching in most cases doesn't cache anything useful; the ResourceBundles simply forward all questions straight to native code anyway, all we're caching is an unnecessary forwarding object (in a cache where lookups cost more than just creating a new unnecessary forwarding object would cost). I've left CurrencyResourceBundle on the slow (ResourceBundle.getBundle) path because I'm not yet sure how much of that path's semantics it relies on. I still return LocaleResourceBundle instances (albeit via a much faster path) but we should fix that. The native code returns an array which ResourceBundle stuffs into a Hashtable and the calling code accesses via hash table lookups. This despite the fact that the keys are a small fixed set known in advance. We could make the native layer and the calling layer simpler and faster by using a "struct", and doing so would make the middle layer go away completely.
Diffstat (limited to 'vm/compiler/codegen')
0 files changed, 0 insertions, 0 deletions