{"id":327886,"date":"2022-01-12T15:01:05","date_gmt":"2022-01-12T15:01:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=327886"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=327886","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u043e\u0447\u0438\u043d\u0438\u0442\u044c HotSpot \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Java<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e, \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u0435\u0440\u0435\u0434 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 \u043a\u0440\u0430\u0442\u043a\u0438\u043c \u043f\u0440\u0435\u0434\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\u043c:<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0434\u0435\u0441\u044c \u0446\u0435\u043b\u044b\u0445 \u0442\u0440\u0438 \u043f\u0443\u043d\u043a\u0442\u0430<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u043c\u043e\u043f\u0435\u0434 \u043d\u0435 \u043c\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u043e\u0448\u0438\u0431\u043a\u0438 \u0432 HotSpot-e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043d\u0451\u043c \u0441\u0430\u043c\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u043c\u043e\u0438 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f \u043e\u0431 \u0430\u0441\u043c\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0438\u0432\u043d\u044b\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h3>\u041f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041a\u0430\u043a-\u0442\u043e \u043d\u0430 \u0421\u041e \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0441\u044f \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: <a href=\"https:\/\/stackoverflow.com\/questions\/70272651\/missing-bounds-checking-elimination-in-string-constructor\" rel=\"noopener noreferrer nofollow\">Missing bounds checking elimination in String constructor?<\/a> \u0410\u0432\u0442\u043e\u0440 \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0432\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0442\u0430\u043a:<\/p>\n<blockquote>\n<p>Looking into UTF8 decoding performance, I noticed the performance of protobuf&#8217;s\u00a0<code>UnsafeProcessor::decodeUtf8<\/code>\u00a0is better than\u00a0<code>String(byte[] bytes, int offset, int length, Charset charset)<\/code>\u00a0for the following non-ascii string:\u00a0<code>\"Quizdeltagerne spiste jordb\u00e6r med fl\u00d8de, mens cirkusklovnen\"<\/code>.<\/p>\n<p>&#8230;<\/p>\n<p>I assume the difference is due to missing bounds checking elimination which I expected to kick in, especially since there is an explicit bounds check in the form of a call to\u00a0<code>checkBoundsOffCount(offset, length, bytes.length)<\/code>\u00a0in the beginning of\u00a0<code>String(byte[] bytes, int offset, int length, Charset charset)<\/code>.<\/p>\n<\/blockquote>\n<p>\u0421\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0443\u043c\u0431\u0443\u0440\u043d\u043e \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e \u0438 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/protocolbuffers\/protobuf\/blob\/master\/java\/core\/src\/main\/java\/com\/google\/protobuf\/Utf8.java#L1369\" rel=\"noopener noreferrer nofollow\">UnsafeProcessor.decodeUtf8()<\/a> \u0438 <a href=\"https:\/\/github.com\/openjdk\/jdk\/blob\/525b20fce0acd393f31fd37fe1f05f9d32577f77\/src\/java.base\/share\/classes\/java\/lang\/String.java#L521\" rel=\"noopener noreferrer nofollow\">String(byte[], int, int, Charset)<\/a>. \u041f\u0435\u0440\u0432\u043e-\u043d\u0430\u043f\u0435\u0440\u0432\u043e \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u043c \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c.<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043d\u0438\u0445 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0430\u0439\u0442\u043e\u0432.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>c.g.p.Utf8.UnsafeProcessor.decodeUtf8()<\/code>, \u0442\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0443 <code>c.g.p.Utf8.SafeProcessor<\/code> \u0438 <code>String(byte[] bytes, int offset, int length, Charset charset)<\/code>, \u0432\u0435\u0434\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044f\u0447\u0435\u0439\u043a\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 <code>UnsafeProcessor.decodeUtf8()<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">while (offset &lt; limit) {   byte b = UnsafeUtil.getByte(bytes, offset);   \/\/...   offset++; }<\/code><\/pre>\n<p><code>UnsafeUtil.getByte()<\/code>\u00a0\u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a <code>Unsafe.getByte()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a &#171;\u0441\u044b\u0440\u043e\u0439&#187; \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 (\u0438 \u043e\u043f\u0430\u0441\u043d\u0435\u0435), \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 <code>SafeProcessor.decodeUtf8()<\/code> (\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0441\u0442\u0440\u043e\u043a\u0438):<\/p>\n<pre><code class=\"java\">while (offset &lt; limit) {   byte b = bytes[offset];   \/\/...   offset++; }<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/gist.github.com\/amirhadadi\/9505c3f5d9ad68cad2fbfd1b9e01f0b8\" rel=\"noopener noreferrer nofollow\">\u0433\u0438\u0441\u0442\u0435<\/a>, \u0430 \u0432\u043e\u0442 \u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>Benchmark                       Mode  Cnt    Score   Error  Units StringBenchmark.safeDecoding    avgt   10  127.107 \u00b1 3.642  ns\/op StringBenchmark.unsafeDecoding  avgt   10  100.915 \u00b1 4.090  ns\/op<\/code><\/pre>\n<p>\u0427\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u044f\u0434\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430? \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043e\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u0432\u044b\u0441\u043a\u0430\u0437\u0430\u043b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e \u0440\u043e\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0433\u043b\u0430\u0434\u0438\u0442\u044c \u044d\u0442\u0443 \u0440\u0430\u0437\u043d\u0438\u0446\u0443:<\/p>\n<pre><code class=\"java\">while (offset &lt; limit) {}  -->  while (0 &lt;= offset &amp;&amp; offset &lt; limit) {}<\/code><\/pre>\n<p>\u0418 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e \u0443\u0440\u0430\u0432\u043d\u044f\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0431\u043e\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<pre><code>Benchmark                       Mode  Cnt    Score    Error  Units StringBenchmark.safeDecoding    avgt   10  100.802 \u00b1 13.147  ns\/op StringBenchmark.unsafeDecoding  avgt   10  102.774 \u00b1  3.893  ns\/op<\/code><\/pre>\n<p>\u041c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438 \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u044f \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043b\u0441\u044f \u043d\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 JDK, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"java\">public String(byte[] bytes, int offset, int length, Charset charset) {   Objects.requireNonNull(charset);   checkBoundsOffCount(offset, length, bytes.length);   if (length == 0) {     this.value = \"\".value;     this.coder = \"\".coder;   } else if (charset == UTF_8.INSTANCE) {     if (COMPACT_STRINGS &amp;&amp; !StringCoding.hasNegatives(bytes, offset, length)) {       this.value = Arrays.copyOfRange(bytes, offset, offset + length);       this.coder = LATIN1;     } else {       int sl = offset + length;       int dp = 0;       byte[] dst = null;       if (COMPACT_STRINGS) {         dst = new byte[length];         while (offset &lt; sl) {           int b1 = bytes[offset];           if (b1 >= 0) {             dst[dp++] = (byte)b1;             offset++;             continue;           }           \/\/... }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a:<\/p>\n<pre><code class=\"java\">@State(Scope.Thread) @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public class StringConstructorBenchmark {   private byte[] array;    @Setup   public void setup() {     var str = \"Quizdeltagerne spiste jordb\u00e6r med fl\u00f8de, mens cirkusklovnen. \u042f\";     array = str.getBytes(StandardCharsets.UTF_8);   }    @Benchmark   public String newString()  {       return new String(array, 0, array.length, StandardCharsets.UTF_8);   } }<\/code><\/pre>\n<p>\u041e\u043f\u044b\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <code>while<\/code> \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u0430\u0451\u0442 \u043e\u0449\u0443\u0442\u0438\u043c\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442:<\/p>\n<pre><code>\/\/ while (offset &lt; sl)  StringConstructorBenchmark.newString     173,092 \u00b1 3,048 ns\/op  \/\/ while (0 &lt;= offset &amp;&amp; offset &lt; sl)  StringConstructorBenchmark.newString     126,908 \u00b1 2,355 ns\/op<\/code><\/pre>\n<h3>\u0421\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u043e\u0447\u0442\u0438 20% \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0445 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<p>\u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u0439: \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443  <code>offset &lt; sl<\/code> \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 <code>0 &lt;= offset &amp;&amp; offset &lt; sl<\/code>, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0437\u0440\u0435\u0432\u0430\u0435\u0442 \u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0437 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u0430 \u0432\u043e\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c, \u0432\u0435\u0434\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>offset<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"java\">public String(byte[] bytes, int offset, int length, Charset charset) {   Objects.requireNonNull(charset);   checkBoundsOffCount(offset, length, bytes.length);   \/\/... }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0440\u0430\u0449\u0435\u043d\u0438\u0435, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>offset<\/code> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c (\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e \u0441\u0430\u043c\u043e\u0439 \u043f\u0435\u0442\u043b\u0451\u0439). \u042d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443. \u041f\u043e\u043f\u0430\u0445\u0438\u0432\u0430\u0435\u0442 \u044f\u0432\u043d\u044b\u043c \u0431\u0430\u0433\u043e\u043c \u0438 \u043e\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0431\u044b\u0442\u044c, \u043d\u043e \u043e\u0431\u043e \u0432\u0441\u0451\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h3>\n<p>\u0414\u043b\u044f \u0443\u0441\u043f\u043e\u043a\u043e\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u0435\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0440\u0435\u0448\u0430\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 &#171;\u0434\u043e&#187; \u0438 &#171;\u043f\u043e\u0441\u043b\u0435&#187;. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c <code>LinuxPerfAsmProfiler<\/code>, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/habr.com\/ru\/post\/542148\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<p>1) \u0431\u0435\u0440\u0451\u043c \u0441\u0432\u0435\u0436\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 OpenJDK \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<pre><code class=\"bash\">bash configure &amp;&amp; make clean &amp;&amp; make images<\/code><\/pre>\n<p>2) \u0431\u0435\u0440\u0451\u043c \u0441\u0432\u0435\u0436\u0438\u0435 binutils (\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0435\u0440c\u0438\u0438 2.37) \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u0442\u0435\u0445 \u0436\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432<\/p>\n<p>3) \u043f\u043e\u0434\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 <code>hsdis-*.so<\/code> \u0432 \u043f\u0430\u043f\u043a\u0443 \u043a <code>libjvm.so<\/code><\/p>\n<p>4) \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u0443\u0435\u043c<\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c &#171;\u0434\u043e&#187; \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d <a href=\"https:\/\/gist.github.com\/stsypanov\/d2524f98477d633fb1d4a2510fedeea6\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c &#171;\u043f\u043e\u0441\u043b\u0435&#187; &#8212; <a href=\"https:\/\/gist.github.com\/stsypanov\/16c787e4f9fa3dd122522f16331b68b7\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. \u0414\u0430\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0442\u043a\u0438 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0446\u0438\u043a\u043b <code>while<\/code>:<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043e<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>2.22% \u2502\u2502   \u2502 0x00007fed70eb4c21:   mov    (%rsp),%r8               ;*iload_2 {reexecute=0 rethrow=0 return_oop=0}       \u2502\u2502   \u2502                                                       ; - java.lang.String::&lt;init>@107 (line 537) 2.32% \u2198\u2502   \u2502 0x00007fed70eb4c25:   cmp    %r13d,%ecx        \u2502   \u2502 0x00007fed70eb4c28:   jge    0x00007fed70eb5388       ;*if_icmpge {reexecute=0 rethrow=0 return_oop=0}        \u2502   \u2502                                                       ; - java.lang.String::&lt;init>@110 (line 537) 3.05%  \u2502   \u2502 0x00007fed70eb4c2e:   cmp    0x8(%rsp),%ecx        \u2502   \u2502 0x00007fed70eb4c32:   jae    0x00007fed70eb5319 2.38%  \u2502   \u2502 0x00007fed70eb4c38:   mov    %r8,(%rsp) 2.64%  \u2502   \u2502 0x00007fed70eb4c3c:   movslq %ecx,%r8 2.46%  \u2502   \u2502 0x00007fed70eb4c3f:   mov    %rax,%rbx 3.44%  \u2502   \u2502 0x00007fed70eb4c42:   sub    %r8,%rbx 2.62%  \u2502   \u2502 0x00007fed70eb4c45:   add    $0x1,%rbx 2.64%  \u2502   \u2502 0x00007fed70eb4c49:   and    $0xfffffffffffffffe,%rbx 2.30%  \u2502   \u2502 0x00007fed70eb4c4d:   mov    %ebx,%r8d 3.08%  \u2502   \u2502 0x00007fed70eb4c50:   add    %ecx,%r8d 2.55%  \u2502   \u2502 0x00007fed70eb4c53:   movslq %r8d,%r8 2.45%  \u2502   \u2502 0x00007fed70eb4c56:   add    $0xfffffffffffffffe,%r8 2.13%  \u2502   \u2502 0x00007fed70eb4c5a:   cmp    (%rsp),%r8        \u2502   \u2502 0x00007fed70eb4c5e:   jae    0x00007fed70eb5319 3.36%  \u2502   \u2502 0x00007fed70eb4c64:   mov    %ecx,%edi                ;*aload_1 {reexecute=0 rethrow=0 return_oop=0}        \u2502   \u2502                                                       ; - java.lang.String::&lt;init>@113 (line 538) 2.86%  \u2502  \u2197\u2502 0x00007fed70eb4c66:   movsbl 0x10(%r14,%rdi,1),%r8d   ;*baload {reexecute=0 rethrow=0 return_oop=0}        \u2502  \u2502\u2502                                                       ; - java.lang.String::&lt;init>@115 (line 538) 2.48%  \u2502  \u2502\u2502 0x00007fed70eb4c6c:   mov    %r9d,%edx 2.26%  \u2502  \u2502\u2502 0x00007fed70eb4c6f:   inc    %edx                     ;*iinc {reexecute=0 rethrow=0 return_oop=0}        \u2502  \u2502\u2502                                                       ; - java.lang.String::&lt;init>@127 (line 540) 3.28%  \u2502  \u2502\u2502 0x00007fed70eb4c71:   mov    %edi,%ebx 2.44%  \u2502  \u2502\u2502 0x00007fed70eb4c73:   inc    %ebx                     ;*iinc {reexecute=0 rethrow=0 return_oop=0}        \u2502  \u2502\u2502                                                       ; - java.lang.String::&lt;init>@134 (line 541) 2.35%  \u2502  \u2502\u2502 0x00007fed70eb4c75:   test   %r8d,%r8d        \u2570  \u2502\u2502 0x00007fed70eb4c78:   jge    0x00007fed70eb4c04       ;*iflt {reexecute=0 rethrow=0 return_oop=0}           \u2502\u2502                                                       ; - java.lang.String::&lt;init>@120 (line 539)<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0441\u043b\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>17.28%    \u2502\u2502 0x00007f6b88eb6061:   mov    %edx,%r10d               ;*iload_2 {reexecute=0 rethrow=0 return_oop=0}           \u2502\u2502                                                       ; - java.lang.String::&lt;init>@107 (line 537)  0.11%    \u2198\u2502 0x00007f6b88eb6064:   test   %r10d,%r10d            \u2502 0x00007f6b88eb6067:   jl     0x00007f6b88eb669c       ;*iflt {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@108 (line 537)  0.39%     \u2502 0x00007f6b88eb606d:   cmp    %r13d,%r10d            \u2502 0x00007f6b88eb6070:   jge    0x00007f6b88eb66d0       ;*if_icmpge {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@114 (line 537)  0.66%     \u2502 0x00007f6b88eb6076:   mov    %ebx,%r9d 13.70%     \u2502 0x00007f6b88eb6079:   cmp    0x8(%rsp),%r10d  0.01%     \u2502 0x00007f6b88eb607e:   jae    0x00007f6b88eb6671  0.14%     \u2502 0x00007f6b88eb6084:   movsbl 0x10(%r14,%r10,1),%edi   ;*baload {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@119 (line 538)  0.37%     \u2502 0x00007f6b88eb608a:   mov    %r9d,%ebx  0.99%     \u2502 0x00007f6b88eb608d:   inc    %ebx                     ;*iinc {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@131 (line 540) 12.88%     \u2502 0x00007f6b88eb608f:   movslq %r9d,%rsi                ;*bastore {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@196 (line 548)  0.17%     \u2502 0x00007f6b88eb6092:   mov    %r10d,%edx  0.39%     \u2502 0x00007f6b88eb6095:   inc    %edx                     ;*iinc {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@138 (line 541)  0.96%     \u2502 0x00007f6b88eb6097:   test   %edi,%edi  0.02%     \u2502 0x00007f6b88eb6099:   jl     0x00007f6b88eb60dc       ;*iflt {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@124 (line 539)<\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430, \u0447\u0442\u043e \u043a\u043e\u0434 &#171;\u043f\u043e\u0441\u043b\u0435&#187; \u0441\u0442\u0430\u043b \u043d\u0430 8 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0440\u043e\u0447\u0435: \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0430\u043c\u0438 <code>if_icmpge<\/code>\u00a0\u0438\u00a0<code>aload_1<\/code> (\u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430) \u043a\u0443\u0434\u0430-\u0442\u043e \u0434\u0435\u043b\u0438\u0441\u044c. \u0412\u043e\u0442 \u043e\u043d\u0438, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433:<\/p>\n<pre><code>2.38%  \u2502   \u2502 0x00007fed70eb4c38:   mov    %r8,(%rsp) 2.64%  \u2502   \u2502 0x00007fed70eb4c3c:   movslq %ecx,%r8 2.46%  \u2502   \u2502 0x00007fed70eb4c3f:   mov    %rax,%rbx 3.44%  \u2502   \u2502 0x00007fed70eb4c42:   sub    %r8,%rbx 2.62%  \u2502   \u2502 0x00007fed70eb4c45:   add    $0x1,%rbx 2.64%  \u2502   \u2502 0x00007fed70eb4c49:   and    $0xfffffffffffffffe,%rbx 2.30%  \u2502   \u2502 0x00007fed70eb4c4d:   mov    %ebx,%r8d 3.08%  \u2502   \u2502 0x00007fed70eb4c50:   add    %ecx,%r8d<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0430\u0433\u0430, \u043c\u0435\u0442\u043e\u0434 <code>String.translateEscapes()<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043a\u043e\u0434<\/p>\n<pre><code class=\"java\">char[] chars = toCharArray(); int length = chars.length; int from = 0; int to = 0; while (from &lt; length) {        \/\/ &lt;---   char ch = chars[from++];   if (ch == '\\\\') {     ch = from &lt; length ? chars[from++] : '\\0';<\/code><\/pre>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0443\u0447\u0438 \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u043c &#171;\u043f\u043e \u043e\u0431\u0440\u0430\u0437\u0443 \u0438 \u043f\u043e\u0434\u043e\u0431\u0438\u044e&#187; \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<pre><code>\/\/ from &lt; length StringConstructorBenchmark.translateEscapes avgt 53,627 \u00b1 0,850 ns\/op  \/\/ from >=0 &amp;&amp; from &lt; length StringConstructorBenchmark.translateEscapes avgt 48,087 \u00b1 1,129 ns\/op<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u043e\u0437\u0434\u0430\u043b <a href=\"https:\/\/bugs.openjdk.java.net\/browse\/JDK-8278518\" rel=\"noopener noreferrer nofollow\">JDK-8278518<\/a> \u0438 \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0441\u043e\u0437\u0434\u0430\u043b \u041f\u0420 \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043a\u043e\u0434\u0435 JDK (\u0442\u0430\u043c \u0436\u0435 \u0441\u043c. \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438). \u0412\u0434\u0440\u0443\u0433 \u0432 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0438 \u0432\u0441\u043f\u043b\u044b\u0432\u0451\u0442 \u0447\u0442\u043e-\u0442\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0435?<\/p>\n<details class=\"spoiler\">\n<summary>\u0418 \u0442\u0430\u043a\u0438 \u0434\u0430!<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412\u043d\u0435\u0437\u0430\u043f\u043d\u043e <a href=\"https:\/\/github.com\/openjdk\/jdk\/pull\/6812#issuecomment-993895335\" rel=\"noopener noreferrer nofollow\">\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c<\/a>, \u0447\u0442\u043e<br \/>1) \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0432\u0448\u0438\u0435 8 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 &#8212; \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430<br \/>2) \u0441\u0430\u043c\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0442\u0430\u043c!<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0430 \u0434\u0435\u043b\u0435 \u0432\u044b\u0445\u043e\u0434 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0443\u043c\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438:<\/p>\n<pre><code>\/\/ \u0434\u043e  0x00007fed70eb4c2e:   cmp    0x8(%rsp),%ecx 0x00007fed70eb4c32:   jae    0x00007fed70eb5319  \/\/ \u043f\u043e\u0441\u043b\u0435  0x00007f6b88eb6079:   cmp    0x8(%rsp),%r10d 0x00007f6b88eb607e:   jae    0x00007f6b88eb6671<\/code><\/pre>\n<p>\u0410 \u0447\u0442\u043e \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u0430\u044e\u0442 \u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0432\u0448\u0438\u0435 8 \u0441\u0442\u0440\u043e\u043a? \u041e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442: \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e. \u0412 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434\u0435 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a<\/p>\n<pre><code>long temp = sl; loop {   long newTemp = (long)((int)((temp - (long)offset + 1) &amp; (-2L)) + offset) - 2L;   if (newTemp u>= temp) jump;   temp = newTemp; }<\/code><\/pre>\n<p>\u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0431\u0430\u0433 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0441\u043c\u043e\u0433 \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0439 \u043a\u043e\u0434, \u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0432 \u043a\u043e\u0434\u0435 \u0441\u0430\u043c\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u043b \u0420\u043e\u043b\u0430\u043d\u0434 \u0412\u0435\u0441\u0442\u0440\u0435\u043b\u0438\u043d. \u0412\u043e\u0442 \u043a\u0430\u043a \u043e\u043d <a href=\"https:\/\/bugs.openjdk.java.net\/browse\/JDK-8278518?focusedCommentId=14465613#comment-14465613\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442<\/a> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435:<\/p>\n<blockquote>\n<p>The loop has 2 backedges. One is frequently taken, the other is not. The loop head is cloned for the least frequent backedge by <code>ciTypeFlow<\/code>. C2 then builds an outer Loop with the most frequently taken backedge and an inner counted loop with the least frequently taken backedge.<br \/>Preventing <code>ciTypeFlow<\/code> from cloning any loop head causes C2 to split the loop head with 2 backedges and to pick the most frequent backedge for the inner loop, which becomes a counted loop and is fully optimized. That leads to the following performance numbers:<\/p>\n<p>StringBenchmark.safeDecoding              65.404 \u00b1  0.723  ns\/op<br \/>StringBenchmark.unsafeDecoding          73.004 \u00b1 12.800 ns\/op<\/p>\n<p>So it would seem that in the case of multiple backedges, <code>ciTypeFlow<\/code> should not get in the way and leave C2 choose the inner loop.<\/p>\n<\/blockquote>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0432\u0441\u0451 \u0435\u0449\u0451 \u0441\u043a\u0440\u044b\u0442\u044b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439, \u0431\u0435\u0434\u0430 \u043b\u0438\u0448\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0445 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0435\u043b\u043e \u0441\u043b\u0443\u0447\u0430\u044f.<\/p>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u0440\u044f\u0434\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d: \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0439 \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d, \u0432 \u043a\u043e\u0434\u0435 JDK \u043a\u0440\u043e\u043c\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u044f \u043d\u0430\u0448\u0451\u043b \u0435\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u0432<\/p>\n<ul>\n<li>\n<p><code>String.decodeASCII()<\/code><\/p>\n<\/li>\n<li>\n<p><code>StringLatin1.regionMatchesCI()<\/code><\/p>\n<\/li>\n<li>\n<p><code>StringLatin1.regionMatchesCI_UTF16()<\/code><\/p>\n<\/li>\n<li>\n<p><code>StringUTF16.replace()<\/code><\/p>\n<\/li>\n<li>\n<p><code>Long.toString(long, int)<\/code><\/p>\n<\/li>\n<li>\n<p><code>StringCoding.implEncodeAsciiArray()<\/code> <\/p>\n<\/li>\n<li>\n<p><code>sun.nio.cs.*.Encoder.encodeArrayLoop()<\/code><\/p>\n<\/li>\n<li>\n<p><code>ZipFile.Source.getMetaVersion()<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0448\u0430\u0431\u043b\u043e\u043d \u0432 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0442\u043e \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0441\u0442\u044b\u043b\u044f (\u0438\u043b\u0438 \u0436\u0434\u0438\u0442\u0435, \u043a\u043e\u0433\u0434\u0430 JDK-8278518 <a href=\"https:\/\/github.com\/openjdk\/jdk\/pull\/7034\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043f\u0440\u0430\u0432\u044f\u0442 \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/a>).<\/p>\n<p>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0451 \ud83d\ude42<\/p>\n<p><strong>UPD<\/strong>: \u0415\u0449\u0451 <a href=\"https:\/\/github.com\/openjdk\/jdk\/pull\/7026\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d \u0441\u043b\u0443\u0447\u0430\u0439<\/a>, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0446\u0438\u043a\u043b\u0435 \u0434\u0430\u0451\u0442 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/598433\/\"> https:\/\/habr.com\/ru\/post\/598433\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e, \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u0435\u0440\u0435\u0434 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 \u043a\u0440\u0430\u0442\u043a\u0438\u043c \u043f\u0440\u0435\u0434\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\u043c:<\/p>\n<details class=\"spoiler\">\n<summary>\u0417\u0434\u0435\u0441\u044c \u0446\u0435\u043b\u044b\u0445 \u0442\u0440\u0438 \u043f\u0443\u043d\u043a\u0442\u0430<\/summary>\n<div class=\"spoiler__content\">\n<ul>\n<li>\n<p>\u043c\u043e\u043f\u0435\u0434 \u043d\u0435 \u043c\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u043e\u0448\u0438\u0431\u043a\u0438 \u0432 HotSpot-e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043d\u0451\u043c \u0441\u0430\u043c\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u043c\u043e\u0438 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f \u043e\u0431 \u0430\u0441\u043c\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0438\u0432\u043d\u044b\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<h3>\u041f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041a\u0430\u043a-\u0442\u043e \u043d\u0430 \u0421\u041e \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0441\u044f \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: <a href=\"https:\/\/stackoverflow.com\/questions\/70272651\/missing-bounds-checking-elimination-in-string-constructor\" rel=\"noopener noreferrer nofollow\">Missing bounds checking elimination in String constructor?<\/a> \u0410\u0432\u0442\u043e\u0440 \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0432\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0442\u0430\u043a:<\/p>\n<blockquote>\n<p>Looking into UTF8 decoding performance, I noticed the performance of protobuf&#8217;s\u00a0<code>UnsafeProcessor::decodeUtf8<\/code>\u00a0is better than\u00a0<code>String(byte[] bytes, int offset, int length, Charset charset)<\/code>\u00a0for the following non-ascii string:\u00a0<code>\"Quizdeltagerne spiste jordb\u00e6r med fl\u00d8de, mens cirkusklovnen\"<\/code>.<\/p>\n<p>&#8230;<\/p>\n<p>I assume the difference is due to missing bounds checking elimination which I expected to kick in, especially since there is an explicit bounds check in the form of a call to\u00a0<code>checkBoundsOffCount(offset, length, bytes.length)<\/code>\u00a0in the beginning of\u00a0<code>String(byte[] bytes, int offset, int length, Charset charset)<\/code>.<\/p>\n<\/blockquote>\n<p>\u0421\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0443\u043c\u0431\u0443\u0440\u043d\u043e \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e \u0438 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/protocolbuffers\/protobuf\/blob\/master\/java\/core\/src\/main\/java\/com\/google\/protobuf\/Utf8.java#L1369\" rel=\"noopener noreferrer nofollow\">UnsafeProcessor.decodeUtf8()<\/a> \u0438 <a href=\"https:\/\/github.com\/openjdk\/jdk\/blob\/525b20fce0acd393f31fd37fe1f05f9d32577f77\/src\/java.base\/share\/classes\/java\/lang\/String.java#L521\" rel=\"noopener noreferrer nofollow\">String(byte[], int, int, Charset)<\/a>. \u041f\u0435\u0440\u0432\u043e-\u043d\u0430\u043f\u0435\u0440\u0432\u043e \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u043c \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c.<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043d\u0438\u0445 \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u0430\u0439\u0442\u043e\u0432.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>c.g.p.Utf8.UnsafeProcessor.decodeUtf8()<\/code>, \u0442\u043e \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0443 <code>c.g.p.Utf8.SafeProcessor<\/code> \u0438 <code>String(byte[] bytes, int offset, int length, Charset charset)<\/code>, \u0432\u0435\u0434\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044f\u0447\u0435\u0439\u043a\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 <code>UnsafeProcessor.decodeUtf8()<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">while (offset &lt; limit) {   byte b = UnsafeUtil.getByte(bytes, offset);   \/\/...   offset++; }<\/code><\/pre>\n<p><code>UnsafeUtil.getByte()<\/code>\u00a0\u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a <code>Unsafe.getByte()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a &#171;\u0441\u044b\u0440\u043e\u0439&#187; \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 (\u0438 \u043e\u043f\u0430\u0441\u043d\u0435\u0435), \u0447\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 <code>SafeProcessor.decodeUtf8()<\/code> (\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0441\u0442\u0440\u043e\u043a\u0438):<\/p>\n<pre><code class=\"java\">while (offset &lt; limit) {   byte b = bytes[offset];   \/\/...   offset++; }<\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/gist.github.com\/amirhadadi\/9505c3f5d9ad68cad2fbfd1b9e01f0b8\" rel=\"noopener noreferrer nofollow\">\u0433\u0438\u0441\u0442\u0435<\/a>, \u0430 \u0432\u043e\u0442 \u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434:<\/p>\n<pre><code>Benchmark                       Mode  Cnt    Score   Error  Units StringBenchmark.safeDecoding    avgt   10  127.107 \u00b1 3.642  ns\/op StringBenchmark.unsafeDecoding  avgt   10  100.915 \u00b1 4.090  ns\/op<\/code><\/pre>\n<p>\u0427\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u044f\u0434\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430? \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043e\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u0432\u044b\u0441\u043a\u0430\u0437\u0430\u043b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e \u0440\u043e\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0433\u043b\u0430\u0434\u0438\u0442\u044c \u044d\u0442\u0443 \u0440\u0430\u0437\u043d\u0438\u0446\u0443:<\/p>\n<pre><code class=\"java\">while (offset &lt; limit) {}  -->  while (0 &lt;= offset &amp;&amp; offset &lt; limit) {}<\/code><\/pre>\n<p>\u0418 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u044d\u0442\u043e \u0443\u0440\u0430\u0432\u043d\u044f\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0431\u043e\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<pre><code>Benchmark                       Mode  Cnt    Score    Error  Units StringBenchmark.safeDecoding    avgt   10  100.802 \u00b1 13.147  ns\/op StringBenchmark.unsafeDecoding  avgt   10  102.774 \u00b1  3.893  ns\/op<\/code><\/pre>\n<p>\u041c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438 \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u044f \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043b\u0441\u044f \u043d\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 JDK, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"java\">public String(byte[] bytes, int offset, int length, Charset charset) {   Objects.requireNonNull(charset);   checkBoundsOffCount(offset, length, bytes.length);   if (length == 0) {     this.value = \"\".value;     this.coder = \"\".coder;   } else if (charset == UTF_8.INSTANCE) {     if (COMPACT_STRINGS &amp;&amp; !StringCoding.hasNegatives(bytes, offset, length)) {       this.value = Arrays.copyOfRange(bytes, offset, offset + length);       this.coder = LATIN1;     } else {       int sl = offset + length;       int dp = 0;       byte[] dst = null;       if (COMPACT_STRINGS) {         dst = new byte[length];         while (offset &lt; sl) {           int b1 = bytes[offset];           if (b1 >= 0) {             dst[dp++] = (byte)b1;             offset++;             continue;           }           \/\/... }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a:<\/p>\n<pre><code class=\"java\">@State(Scope.Thread) @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public class StringConstructorBenchmark {   private byte[] array;    @Setup   public void setup() {     var str = \"Quizdeltagerne spiste jordb\u00e6r med fl\u00f8de, mens cirkusklovnen. \u042f\";     array = str.getBytes(StandardCharsets.UTF_8);   }    @Benchmark   public String newString()  {       return new String(array, 0, array.length, StandardCharsets.UTF_8);   } }<\/code><\/pre>\n<p>\u041e\u043f\u044b\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f <code>while<\/code> \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u0430\u0451\u0442 \u043e\u0449\u0443\u0442\u0438\u043c\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442:<\/p>\n<pre><code>\/\/ while (offset &lt; sl)  StringConstructorBenchmark.newString     173,092 \u00b1 3,048 ns\/op  \/\/ while (0 &lt;= offset &amp;&amp; offset &lt; sl)  StringConstructorBenchmark.newString     126,908 \u00b1 2,355 ns\/op<\/code><\/pre>\n<h3>\u0421\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u043e\u0447\u0442\u0438 20% \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u0445 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<p>\u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u0443\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u0439: \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443  <code>offset &lt; sl<\/code> \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 <code>0 &lt;= offset &amp;&amp; offset &lt; sl<\/code>, \u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0437\u0440\u0435\u0432\u0430\u0435\u0442 \u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u0437 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u0430 \u0432\u043e\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c, \u0432\u0435\u0434\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>offset<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"java\">public String(byte[] bytes, int offset, int length, Charset charset) {   Objects.requireNonNull(charset);   checkBoundsOffCount(offset, length, bytes.length);   \/\/... }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0440\u0430\u0449\u0435\u043d\u0438\u0435, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>offset<\/code> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c (\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e \u0441\u0430\u043c\u043e\u0439 \u043f\u0435\u0442\u043b\u0451\u0439). \u042d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443. \u041f\u043e\u043f\u0430\u0445\u0438\u0432\u0430\u0435\u0442 \u044f\u0432\u043d\u044b\u043c \u0431\u0430\u0433\u043e\u043c \u0438 \u043e\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0431\u044b\u0442\u044c, \u043d\u043e \u043e\u0431\u043e \u0432\u0441\u0451\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h3>\n<p>\u0414\u043b\u044f \u0443\u0441\u043f\u043e\u043a\u043e\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u0435\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0440\u0435\u0448\u0430\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 &#171;\u0434\u043e&#187; \u0438 &#171;\u043f\u043e\u0441\u043b\u0435&#187;. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c <code>LinuxPerfAsmProfiler<\/code>, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/habr.com\/ru\/post\/542148\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439:<\/p>\n<p>1) \u0431\u0435\u0440\u0451\u043c \u0441\u0432\u0435\u0436\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 OpenJDK \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<pre><code class=\"bash\">bash configure &amp;&amp; make clean &amp;&amp; make images<\/code><\/pre>\n<p>2) \u0431\u0435\u0440\u0451\u043c \u0441\u0432\u0435\u0436\u0438\u0435 binutils (\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0435\u0440c\u0438\u0438 2.37) \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u0442\u0435\u0445 \u0436\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432<\/p>\n<p>3) \u043f\u043e\u0434\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 <code>hsdis-*.so<\/code> \u0432 \u043f\u0430\u043f\u043a\u0443 \u043a <code>libjvm.so<\/code><\/p>\n<p>4) \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u0443\u0435\u043c<\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c &#171;\u0434\u043e&#187; \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d <a href=\"https:\/\/gist.github.com\/stsypanov\/d2524f98477d633fb1d4a2510fedeea6\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c &#171;\u043f\u043e\u0441\u043b\u0435&#187; &#8212; <a href=\"https:\/\/gist.github.com\/stsypanov\/16c787e4f9fa3dd122522f16331b68b7\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. \u0414\u0430\u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0442\u043a\u0438 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0446\u0438\u043a\u043b <code>while<\/code>:<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043e<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>2.22% \u2502\u2502   \u2502 0x00007fed70eb4c21:   mov    (%rsp),%r8               ;*iload_2 {reexecute=0 rethrow=0 return_oop=0}       \u2502\u2502   \u2502                                                       ; - java.lang.String::&lt;init>@107 (line 537) 2.32% \u2198\u2502   \u2502 0x00007fed70eb4c25:   cmp    %r13d,%ecx        \u2502   \u2502 0x00007fed70eb4c28:   jge    0x00007fed70eb5388       ;*if_icmpge {reexecute=0 rethrow=0 return_oop=0}        \u2502   \u2502                                                       ; - java.lang.String::&lt;init>@110 (line 537) 3.05%  \u2502   \u2502 0x00007fed70eb4c2e:   cmp    0x8(%rsp),%ecx        \u2502   \u2502 0x00007fed70eb4c32:   jae    0x00007fed70eb5319 2.38%  \u2502   \u2502 0x00007fed70eb4c38:   mov    %r8,(%rsp) 2.64%  \u2502   \u2502 0x00007fed70eb4c3c:   movslq %ecx,%r8 2.46%  \u2502   \u2502 0x00007fed70eb4c3f:   mov    %rax,%rbx 3.44%  \u2502   \u2502 0x00007fed70eb4c42:   sub    %r8,%rbx 2.62%  \u2502   \u2502 0x00007fed70eb4c45:   add    $0x1,%rbx 2.64%  \u2502   \u2502 0x00007fed70eb4c49:   and    $0xfffffffffffffffe,%rbx 2.30%  \u2502   \u2502 0x00007fed70eb4c4d:   mov    %ebx,%r8d 3.08%  \u2502   \u2502 0x00007fed70eb4c50:   add    %ecx,%r8d 2.55%  \u2502   \u2502 0x00007fed70eb4c53:   movslq %r8d,%r8 2.45%  \u2502   \u2502 0x00007fed70eb4c56:   add    $0xfffffffffffffffe,%r8 2.13%  \u2502   \u2502 0x00007fed70eb4c5a:   cmp    (%rsp),%r8        \u2502   \u2502 0x00007fed70eb4c5e:   jae    0x00007fed70eb5319 3.36%  \u2502   \u2502 0x00007fed70eb4c64:   mov    %ecx,%edi                ;*aload_1 {reexecute=0 rethrow=0 return_oop=0}        \u2502   \u2502                                                       ; - java.lang.String::&lt;init>@113 (line 538) 2.86%  \u2502  \u2197\u2502 0x00007fed70eb4c66:   movsbl 0x10(%r14,%rdi,1),%r8d   ;*baload {reexecute=0 rethrow=0 return_oop=0}        \u2502  \u2502\u2502                                                       ; - java.lang.String::&lt;init>@115 (line 538) 2.48%  \u2502  \u2502\u2502 0x00007fed70eb4c6c:   mov    %r9d,%edx 2.26%  \u2502  \u2502\u2502 0x00007fed70eb4c6f:   inc    %edx                     ;*iinc {reexecute=0 rethrow=0 return_oop=0}        \u2502  \u2502\u2502                                                       ; - java.lang.String::&lt;init>@127 (line 540) 3.28%  \u2502  \u2502\u2502 0x00007fed70eb4c71:   mov    %edi,%ebx 2.44%  \u2502  \u2502\u2502 0x00007fed70eb4c73:   inc    %ebx                     ;*iinc {reexecute=0 rethrow=0 return_oop=0}        \u2502  \u2502\u2502                                                       ; - java.lang.String::&lt;init>@134 (line 541) 2.35%  \u2502  \u2502\u2502 0x00007fed70eb4c75:   test   %r8d,%r8d        \u2570  \u2502\u2502 0x00007fed70eb4c78:   jge    0x00007fed70eb4c04       ;*iflt {reexecute=0 rethrow=0 return_oop=0}           \u2502\u2502                                                       ; - java.lang.String::&lt;init>@120 (line 539)<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0441\u043b\u0435<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>17.28%    \u2502\u2502 0x00007f6b88eb6061:   mov    %edx,%r10d               ;*iload_2 {reexecute=0 rethrow=0 return_oop=0}           \u2502\u2502                                                       ; - java.lang.String::&lt;init>@107 (line 537)  0.11%    \u2198\u2502 0x00007f6b88eb6064:   test   %r10d,%r10d            \u2502 0x00007f6b88eb6067:   jl     0x00007f6b88eb669c       ;*iflt {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@108 (line 537)  0.39%     \u2502 0x00007f6b88eb606d:   cmp    %r13d,%r10d            \u2502 0x00007f6b88eb6070:   jge    0x00007f6b88eb66d0       ;*if_icmpge {reexecute=0 rethrow=0 return_oop=0}            \u2502                                                       ; - java.lang.String::&lt;init>@114 (line 537)  0.66%     \u2502 0x00007f6b88eb6076:   mov    %ebx,%r9d 13.70%     \u2502 0x00007f6b88eb6079:   cmp    0x8(%rsp),%r10d  0.01%     \u2502 0x00007f6b88eb607e:   jae    0x00007f6b88eb6671  0.14%     \u2502 0x00007f6b88eb6084:   movsbl 0x10(%r14,%r10,1),%edi   ;*baload {reexecute=0 rethrow=0 return_oop=0}            \u2502                    <\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-327886","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=327886"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327886\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}