public Label getOrCreateLabel(String string) {
        if (string == null) {
            return INVALID_INDEX_LABEL;
        }

        // Index labels are not cached.
        // They are not cached, but rather pre-computed for small values or created on demand.
        if (validNumericIndex(string)) {
            try {
                var numeric = Long.parseLong(string, 10);

                if (numeric < smallIndex.length) {
                    return smallIndex[(int) numeric];
                }

                return new LabelImpl(numeric, string);
            } catch(NumberFormatException e){
                // Continue with cached labels
            }
        }
        
        var existingLabel = getLabel(string);
        if (existingLabel != null) {
            return existingLabel;
        }
        
        return createLabel(string);
    }
Creates a label cache.

@param lockStripes number of lock stripes, should be proportional to the number of threads using the cache.
@param smallIndexSize size of a cache used to store pre-computed labels for small index labels.
vespajlib/src/main/java/com/yahoo/tensor/impl/LabelCache.java