private synchronized void sortFieldListAndCachePositions() {
        // de-dup the list
        fields = new ArrayList<>(new HashSet<>(fields));
        Collections.sort(fields);

        cachedFieldPositions = new HashMap<>();
        int i = 0;
        for (final StatisticField field : fields) {
            cachedFieldPositions.put(field.getFieldName(), i++);
        }
    }
Cache the positions of the fields.
stroom-core-shared/src/main/java/stroom/statistics/impl/hbase/shared/StroomStatsStoreEntityData.java