Почему собственный метод String getBytes медленнее, чем встроенный метод getBytesFast?

При выполнении следующего фрагмента кода выполнение нативного метода Java StringgetBytes() кажетсяslower чем обычайgetBytesFast() реализация. Вы можете использоватьArrays.equals(str.getBytes(), getBytesFast(str)) чтобы убедиться, что оба байтовых массива равны.

Реализация getBytesFast является модифицированной версией реализации, включенной в эту статью советов по программированию (1997):http://java.sun.com/developer/technicalArticles/Programming/Performance/

Я ищу хорошо документированный ответ о том, почему собственная реализация медленнее, чем пользовательская реализация.

package com.test;

public class Performance {

    public static void main(String args[]) {

        final String str = "This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test! This is a performance test!";

        long startTime_1 = System.nanoTime();
        str.getBytes();
        System.out.println(System.nanoTime() - startTime_1);

        long startTime_2 = System.nanoTime();
        getBytesFast(str);
        System.out.println(System.nanoTime() - startTime_2);
    }

    private static byte[] getBytesFast(String str) {
        final char buffer[] = new char[str.length()];
        final int length = str.length();
        str.getChars(0, length, buffer, 0);
        final byte b[] = new byte[length];
        for (int j = 0; j < length; j++)
            b[j] = (byte) buffer[j];
        return b;
    }
}

EDITED:

Результаты теста суппорта

enter image description here

Спасибо

Ответы на вопрос(3)

Ваш ответ на вопрос