use of com.perl5.lang.perl.util.PerlTimeLogger in project Perl5-IDEA by Camelcade.
the class PerlUnicodeNamesCompletionProvider method addCompletions.
@Override
protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) {
PerlSimpleCompletionProcessor completionProcessor = new PerlSimpleCompletionProcessor(parameters, result.caseInsensitive(), parameters.getPosition());
Map<String, String> cache = myNamesCacheRef.get();
if (cache == null) {
LOG.debug("Cache been collected, re-init");
cache = new HashMap<>();
myCodePoint = 0;
myNamesCacheRef = new SoftReference<>(cache);
}
PerlTimeLogger logger = PerlTimeLogger.create(LOG);
fillCached(completionProcessor, cache);
logger.debug("Filled cached unicode names");
lazyCache(completionProcessor, cache);
logger.debug("Lazily populated cache of unicode names");
if (LOG.isDebugEnabled()) {
LOG.debug("Cached entries: ", cache.size(), "; data size, mb: ", (float) myDataSize / 1024 / 1024);
}
completionProcessor.logStatus(getClass());
}
use of com.perl5.lang.perl.util.PerlTimeLogger in project Perl5-IDEA by Camelcade.
the class PerlParserImpl method parseLight.
@Override
public void parseLight(IElementType root_, PsiBuilder builder_) {
PerlTimeLogger logger = PerlTimeLogger.create(LOG);
super.parseLight(root_, builder_);
logger.trace("Light parsed ", root_, " ", PerlTimeLogger.kb(builder_.getOriginalText().length()), " kb");
}
Aggregations