mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-09 07:24:41 +00:00
[HER-1762] H3 performance tuning
Charset lookup sync de-bottlenecking
* org/apache/commons/httpclient/EncodingUtil.java
use explicit Charset instances or cached to minimize lookups
* LaxURLCodec, BdbMultipleWorkQueues
use explicit Charset instances
This commit is contained in:
1 parent
7678326121
commit
c1b8138d4d
3 files changed
+46
-22
No files matched your search
@@ -35,6 +35,7 @@ import org.archive.bdb.KryoBinding;
|
||||
import org.archive.modules.CrawlURI;
|
||||
import org.archive.util.ArchiveUtils;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.sleepycat.bind.EntryBinding;
|
||||
import com.sleepycat.bind.serial.StoredClassCatalog;
|
||||
import com.sleepycat.je.Cursor;
|
||||
@@ -424,13 +425,8 @@ public class BdbMultipleWorkQueues {
|
||||
static DatabaseEntry calculateInsertKey(CrawlURI curi) {
|
||||
byte[] classKeyBytes = null;
|
||||
int len = 0;
|
||||
try {
|
||||
classKeyBytes = curi.getClassKey().getBytes("UTF-8");
|
||||
len = classKeyBytes.length;
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// should be impossible; all JVMs must support UTF-8
|
||||
e.printStackTrace();
|
||||
}
|
||||
classKeyBytes = curi.getClassKey().getBytes(Charsets.UTF_8);
|
||||
len = classKeyBytes.length;
|
||||
byte[] keyData = new byte[len+9];
|
||||
System.arraycopy(classKeyBytes,0,keyData,0,len);
|
||||
keyData[len]=0;
|
||||
|
||||
Reference in new issue
Block a user