From 535b6b953c4fa5e43e8119f2405a0f8a8863148d Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 30 May 2011 07:31:17 +0000 Subject: [PATCH] more hacks to omit superfluous string object allocation git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7757 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/IndexControlRWIs_p.java | 5 +++-- source/de/anomic/search/MetadataRepository.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htroot/IndexControlRWIs_p.java b/htroot/IndexControlRWIs_p.java index 1b9fc90e6..05764736c 100644 --- a/htroot/IndexControlRWIs_p.java +++ b/htroot/IndexControlRWIs_p.java @@ -414,7 +414,8 @@ public class IndexControlRWIs_p { public static void genURLList(final serverObjects prop, final byte[] keyhash, final String keystring, final RankingProcess ranked, final Bitfield flags, final int maxlines) { // search for a word hash and generate a list of url links - prop.put("genUrlList_keyHash", ASCII.String(keyhash)); + String keyhashs = ASCII.String(keyhash); + prop.put("genUrlList_keyHash", keyhashs); if (ranked.filteredCount() == 0) { prop.put("genUrlList", 1); @@ -440,7 +441,7 @@ public class IndexControlRWIs_p { prop.put("genUrlList_urlList_"+i+"_urlExists_urlhxCount", i); prop.putHTML("genUrlList_urlList_"+i+"_urlExists_urlhxValue", entry.word().urlhash()); prop.putHTML("genUrlList_urlList_"+i+"_urlExists_keyString", keystring); - prop.put("genUrlList_urlList_"+i+"_urlExists_keyHash", ASCII.String(keyhash)); + prop.put("genUrlList_urlList_"+i+"_urlExists_keyHash", keyhashs); prop.putHTML("genUrlList_urlList_"+i+"_urlExists_urlString", us); prop.put("genUrlList_urlList_"+i+"_urlExists_urlStringShort", (us.length() > 40) ? (us.substring(0, 20) + "
" + us.substring(20, 40) + "...") : ((us.length() > 30) ? (us.substring(0, 20) + "
" + us.substring(20)) : us)); prop.putNum("genUrlList_urlList_"+i+"_urlExists_ranking", (entry.ranking() - rn)); diff --git a/source/de/anomic/search/MetadataRepository.java b/source/de/anomic/search/MetadataRepository.java index 958eede8a..3b5bd119b 100644 --- a/source/de/anomic/search/MetadataRepository.java +++ b/source/de/anomic/search/MetadataRepository.java @@ -590,7 +590,7 @@ public final class MetadataRepository implements Iterable { URLHashCounter ds; if (i != null) while (i.hasNext()) { urlhashb = i.next(); - hosthash = ASCII.String(urlhashb).substring(6); + hosthash = ASCII.String(urlhashb, 6, 6); ds = map.get(hosthash); if (ds == null) { ds = new URLHashCounter(urlhashb); @@ -653,7 +653,7 @@ public final class MetadataRepository implements Iterable { ScoreMap hosthashScore = new ConcurrentScoreMap(); for (Map.Entry e: domainSamples.entrySet()) { - hosthashScore.inc(ASCII.String(e.getValue().urlhashb).substring(6), e.getValue().count); + hosthashScore.inc(ASCII.String(e.getValue().urlhashb, 6, 6), e.getValue().count); } URIMetadataRow.Components comps; DigestURI url;