Are groovy’s literal lists e.g. ['foo','bar','baz'] backed by an ArrayList (dynamic array), or a LinkedList? There are performance benefits when using one instead of the other in different situations.
Related: is there a way I can find out the type of a variable at runtime in groovy, similar to JavaScript’s typeof operator?
Unless specified it creates it as an ArrayList. You can specify a linked list by
def myList = [] as LinkedListor by instantiating directlydef myLinkedList = new LinkedList()myList.getClass().namewill tell you the type.