Details
Description
Replace LinkedList with ArrayList implementation in the StateStoreFileImpl class. This is especially advantageous because we can pre-allocate the internal array before a copy occurs. ArrayList is faster for iterations and requires less memory than LinkedList.
protected List<String> getChildren(String path) { List<String> ret = new LinkedList<>(); File dir = new File(path); File[] files = dir.listFiles(); if (files != null) { for (File file : files) { String filename = file.getName(); ret.add(filename); } } return ret; }