prefixcommons/curie-util

String.format performance

Closed this issue · 1 comments

Current lore states that String.format is a few orders of magnitude slower than a simple concatenation, so

String.format("%s:%s", curiePrefix, iri.substring(prefix.length(), iri.length());

and

String.format("%s%s", curieMap.get(prefix), curie.substring(curie.indexOf(':') + 1));

Might perform better with a simple string concatenation in large ontologies, especially given you're not really formatting anything.

curieMap.get(prefix) + curie.substring(curie.indexOf(':') + 1);

Thanks good catch!