Java SE 8時点ではリフレクションを使ったインスタンス生成はほぼ問題にならない程度に早いらしい
ただし、Classオブジェクトをキャッシュした場合。
コード
public class Hoge { public static void main(String[] args) throws ReflectiveOperationException { //一回目はウォームアップ test1(); test2(); test3(); test1(); test2(); test3(); } private static void test1() { Date d = new Date(); for (int i = 0; i < Integer.MAX_VALUE - 1; i++) { String s = new String(); } System.out.println("test1: " + (new Date().getTime() - d.getTime())); } private static void test2() throws ReflectiveOperationException { Date d = new Date(); Class c = String.class; for (int i = 0; i < Integer.MAX_VALUE - 1; i++) { String s = (String) c.newInstance(); } System.out.println("test2: " + (new Date().getTime() - d.getTime())); } private static void test3() throws ReflectiveOperationException { Date d = new Date(); for (int i = 0; i < Integer.MAX_VALUE - 1; i++) { String s = (String) Class.forName("java.lang.String").newInstance(); } System.out.println("test3: " + (new Date().getTime() - d.getTime())); } }