easyexcel
easyexcel copied to clipboard
读取一个140M的excel,该如何开启日志判断调整maxCacheActivateBatchCount?
long start = System.currentTimeMillis();
log.info("开始导入excel");
File file = new File("E:\\EasyExcel导出1699356093725.xlsx");
SimpleReadCacheSelector simpleReadCacheSelector = new SimpleReadCacheSelector();
simpleReadCacheSelector.setMaxUseMapCacheSize(5L);
simpleReadCacheSelector.setMaxCacheActivateBatchCount(20);
EasyExcel.read(file, Order.class,new OrderDataListener(orderMapper)).readCacheSelector(simpleReadCacheSelector).doReadAll();
long end = System.currentTimeMillis();
log.info("导入excel结束,耗时:{}ms",end-start);
上面是我的代码,读取一个500w行的excel,耗时1分40s,不知道文档里写的开启debug日志会输出Already put :4000000,Cache misses count:4001 是怎么弄的?
我开启debug日志,依旧无法显示这两个参数。
logging.level.com.alibaba.excel = debug
甚至对所有的包开启debug,依旧在日志中搜索不到,是哪里出了问题?
logging.level.root = debug
开了debug后,无论怎么配置参数都是走到这个逻辑(SimpleReadCacheSelector.java类):
if (size < maxUseMapCacheSize * B2M) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Use map cache.size:{}", size); } return new MapCache(); }
这个size取得数据才是123,除非配置maxUseMapCacheSize为零才行走到下面使用Ehcache.java
我也求助,怎么配置
你好,我们发现此Issue已经超过三个月没有活动了,为了更好的帮助您解决问题,我们将在两周后关闭此Issue,如果您仍然有问题,请在两周内内回复此Issue,谢谢!如果您已经解决或者不需要帮助,请忽略此消息。