Java:JCifs.jar:通过smb读取文件需要很长时间

Java:JCifs.jar:通过smb读取文件需要很长时间,java,jcifs,Java,Jcifs,我使用jcifs库从使用smb的网络系统读取文件数据。代码片段如下所示。我观察到读取API对性能的巨大影响。read()需要很长时间。读了这么多博客后,我修改了代码,仍然没有改进。你能帮个忙吗 SmbFile smbFileTest = new SmbFile(fileurl, authentication); //Takes 20sec SmbFileInputStream input = new SmbFileInputStream(smbFileTest); byte[] data = n

我使用jcifs库从使用smb的网络系统读取文件数据。代码片段如下所示。我观察到读取API对性能的巨大影响。read()需要很长时间。读了这么多博客后,我修改了代码,仍然没有改进。你能帮个忙吗

SmbFile smbFileTest = new SmbFile(fileurl, authentication); //Takes 20sec
SmbFileInputStream input = new SmbFileInputStream(smbFileTest);
byte[] data = new byte[length];
int count = input.read(data); //takes nearly 15-20min to read a 135MB file. Also the length, i have provided is only to read 128KB. Still its taking huge time.

The below are my jcif config, i did after reading other post
System.setProperty("jcifs.resolveOrder", "DNS");
System.setProperty("jcifs.smb.client.dfs.disabled", "false"); //Changed true to false no improvement
System.setProperty("jcifs.smb.client.responseTimeout", "120000");
System.setProperty("jcifs.smb.client.disablePlainTextPasswords", "false");
System.setProperty("jcifs.util.loglevel", "3"); 

谢谢

您好,我再次观察到,性能问题因系统而异。有什么东西会影响网络吗…你真的需要所有的字节吗?也可以先区分修改时间戳,以避免无故读取字节。