diff --git a/p1/README.txt b/p1/README.txt new file mode 100644 index 0000000..5530fbf --- /dev/null +++ b/p1/README.txt @@ -0,0 +1,15 @@ +(a) What have you observed to be the fastest Load operation? + [X] Main-memory Load. [ ] MapDB Load + +(b) Why do you think that load operation was faster? + Main memory is higher on the memory hiearchy than disk. + +(c) What have you observed to be the fastest Select operation? + [ ] File Select [X] Main-memory Select. [ ] MapDB Select + +(d) Why do you think that select operation was faster? + Main memory is higher on the memory hiearchy than disk. + +(e) What are the benefits of using the embedded database as backend compare to the in- +memory storage? + Much more storage is available on disk via the embedded database than in main memory. diff --git a/p1/src/main/java/cs448/project1.java b/p1/src/main/java/cs448/project1.java index 65a43e8..05e2eff 100644 --- a/p1/src/main/java/cs448/project1.java +++ b/p1/src/main/java/cs448/project1.java @@ -104,6 +104,6 @@ public class project1 { } String select_mapdb(String key){ - return mm_map.get(key); + return mapdb.get(key); } } diff --git a/p1/test b/p1/test index ee582cb..8a26fcb 100755 --- a/p1/test +++ b/p1/test @@ -1,7 +1,6 @@ #! /bin/bash testCase() { - rm ./data.db java -cp ./target/cs448p1-1.0-SNAPSHOT-jar-with-dependencies.jar -Xmx32m cs448.App "$1" "$2" "$3" } @@ -15,22 +14,29 @@ testCase $data_10 $file nm0000001 testCase $data_10 $file nm0028516 testCase $data_10 $file nm0072686 testCase $data_10 $file nm0438120 -testCase $data_10 $mem nm0000001 -testCase $data_10 $mem nm0028516 -testCase $data_10 $mem nm0072686 -testCase $data_10 $mem nm0438120 -testCase $data_10 $db nm0000001 -testCase $data_10 $db nm0028516 -testCase $data_10 $db nm0072686 -testCase $data_10 $db nm0438120 + testCase $data_30 $file nm0000001 testCase $data_30 $file nm0028516 testCase $data_30 $file nm0072686 testCase $data_30 $file nm0438120 + +testCase $data_10 $mem nm0000001 +testCase $data_10 $mem nm0028516 +testCase $data_10 $mem nm0072686 +testCase $data_10 $mem nm0438120 + testCase $data_30 $mem nm0000001 testCase $data_30 $mem nm0028516 testCase $data_30 $mem nm0072686 testCase $data_30 $mem nm0438120 + +rm ./data.db +testCase $data_10 $db nm0000001 +testCase $data_10 $db nm0028516 +testCase $data_10 $db nm0072686 +testCase $data_10 $db nm0438120 + +rm ./data.db testCase $data_30 $db nm0000001 testCase $data_30 $db nm0028516 testCase $data_30 $db nm0072686