[ https://issues.apache.org/jira/browse/PHOENIX-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gabriel Reid updated PHOENIX-2289: ---------------------------------- Attachment: PHOENIX-2289.patch Patch which caches PhoenixContextExecutor class loader. Thanks for catching this [~tlipcon]. Just curious, which JVM version were you using? I thought that the fix for the expense of getClassLoader was back-ported everywhere. > PhoenixContextExecutor spends a lot of time in getClassLoader > ------------------------------------------------------------- > > Key: PHOENIX-2289 > URL: https://issues.apache.org/jira/browse/PHOENIX-2289 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.3.0 > Reporter: Todd Lipcon > Attachments: PHOENIX-2289.patch > > > Doing some "poor man's profiling" of a CSV bulk import job, I noticed a lot > of time spent in this stack: > {code} > "main" prio=10 tid=0x00007f3410018000 nid=0x6f3f runnable [0x00007f3414b4e000] > java.lang.Thread.State: RUNNABLE > at java.lang.Class.getClassLoader0(Native Method) > at java.lang.Class.getClassLoader(Class.java:609) > at > org.apache.phoenix.util.PhoenixContextExecutor$CurrentContextWrapper.before(PhoenixContextExecutor.java:45) > at org.apache.phoenix.call.CallRunner.run(CallRunner.java:51) > at > org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:270) > at > org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:211) > at > org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:174) > at > org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:179) > at > org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:155) > at > org.apache.phoenix.util.csv.CsvUpsertExecutor.execute(CsvUpsertExecutor.java:136) > at > org.apache.phoenix.mapreduce.CsvToKeyValueMapper.map(CsvToKeyValueMapper.java:163) > at > org.apache.phoenix.mapreduce.CsvToKeyValueMapper.map(CsvToKeyValueMapper.java:69) > {code} > Class.getClassLoader is relatively expensive (see > http://bugs.java.com/view_bug.do?bug_id=6642881 ) so it may make sense to > cache this classloader as a static final member of the class. -- This message was sent by Atlassian JIRA (v6.3.4#6332)