benedekh / WeLoveClouds

Repository for submissions on the CloudDB course.
0 stars 1 forks source link

Fix/#102 #205

Closed benedekh closed 7 years ago

benedekh commented 7 years ago

Before merge, please have a look at #217.

Some experiments (code):

MovablePersistentStorage pss = new MovablePersistentStorage(Paths.get("E://"));
DateTime start = DateTime.now();

for(int i = 0; i < 400; ++i){
    pss.putEntry(new KVEntry(String.valueOf(i), String.valueOf(i)));
}
for(int i = 0; i < 250; ++i){
    pss.removeEntry(String.valueOf(i));
}
for(int i = 250; i < 390; ++i){
   pss.removeEntry(String.valueOf(i));
}
pss.defragment();

DateTime end = DateTime.now();
System.out.println(end.getMillis() - start.getMillis());
System.out.println(Seconds.secondsBetween(start, end));

Average runtime in milliseconds if storage units are not persisted after every operation: 1159 Average runtime in milliseconds if storage units are persisted after every operation: 2362

benedekh commented 7 years ago

won't merge due to performance issues