Will first line work faster than second line in GWT? Is there difference of translation this code in JavaScript in different GWT versions?
ArrayList<String> list = new ArrayList<String>();
List<String> list = new ArrayList<String>();
As i know if i will write declearet type List, JavaScript performance will be worst, because will check is this List LinkedList or ArrayList or other type of list. Is it right?
Will it improve performance if i will write
ArrayList<String> list = new ArrayList<String>();
instead of
List<String> list = new ArrayList<String>();
?
Both lines are equivalent. The GWT compiler performs an optimization called “type tightening.” You can watch how the compiler optimizes a particular method by defining a Java environment property when you compile a module:
From the
JProgramsource: