Improve loading performance

This commit is contained in:
2021-01-08 15:04:30 +01:00
parent 23ad84ef30
commit 8700e2fdde
7 changed files with 145 additions and 48 deletions

View File

@ -75,6 +75,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
@Override
public boolean load(IWaveformDb db, File file) throws InputFormatException {
dispose();
if(file.isDirectory() || !file.exists()) return false;
try(FileInputStream fis = new FileInputStream(file)) {
byte[] buffer = new byte[x.length];
@ -100,7 +101,12 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
}
return false;
}
public void dispose() {
database=null;
usedRelationsList=null;
}
@Override
public Collection<RelationType> getAllRelationTypes(){
return usedRelationsList;