Details
-
Bug
-
Resolution: Fixed
-
P3
-
11, 12
-
b09
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8219665 | 12.0.2 | Aleksey Shipilev | P3 | Resolved | Fixed | b01 |
JDK-8226582 | 11.0.5-oracle | Aleksey Shipilev | P3 | Resolved | Fixed | b02 |
JDK-8219529 | 11.0.3 | Aleksey Shipilev | P3 | Resolved | Fixed | master |
Description
After JDK-8195097 in stringTable::intern the pre-insert lookup is done using a new String oop rather than the jchar* + len, which adds overhead in places like java_lang_StackTraceElement::fill_in - see https://stackoverflow.com/a/54015664/2397895
The following naive patch speeds up microbenchmarks throwing and consuming stack traces by 1.33x on my machine:
diff -r d3e199e30cfb src/hotspot/share/classfile/stringTable.cpp
--- a/src/hotspot/share/classfile/stringTable.cpp Thu Jan 03 02:26:42 2019 +0100
+++ b/src/hotspot/share/classfile/stringTable.cpp Thu Jan 03 10:29:24 2019 +0100
@@ -334,6 +334,10 @@
if (StringTable::_alt_hash) {
hash = hash_string(name, len, true);
}
+ found_string = StringTable::the_table()->do_lookup(name, len, hash);
+ if (found_string != NULL) {
+ return found_string;
+ }
return StringTable::the_table()->do_intern(string_or_null_h, name, len,
hash, CHECK_NULL);
}
The following naive patch speeds up microbenchmarks throwing and consuming stack traces by 1.33x on my machine:
diff -r d3e199e30cfb src/hotspot/share/classfile/stringTable.cpp
--- a/src/hotspot/share/classfile/stringTable.cpp Thu Jan 03 02:26:42 2019 +0100
+++ b/src/hotspot/share/classfile/stringTable.cpp Thu Jan 03 10:29:24 2019 +0100
@@ -334,6 +334,10 @@
if (StringTable::_alt_hash) {
hash = hash_string(name, len, true);
}
+ found_string = StringTable::the_table()->do_lookup(name, len, hash);
+ if (found_string != NULL) {
+ return found_string;
+ }
return StringTable::the_table()->do_intern(string_or_null_h, name, len,
hash, CHECK_NULL);
}
Attachments
Issue Links
- backported by
-
JDK-8219529 stringTable::intern creates redundant String when looking up existing one
- Resolved
-
JDK-8219665 stringTable::intern creates redundant String when looking up existing one
- Resolved
-
JDK-8226582 stringTable::intern creates redundant String when looking up existing one
- Resolved
- relates to
-
JDK-8151751 Stack trace population code can (re-)use cached Strings
- Closed
-
JDK-8208142 Fix perf regression for simple startup benchmarks in new SymbolTable
- Resolved