- int count;
- bool is;
- TextCollection::document_result res;
- TextCollection *tc;
- tc = tc64;
- std::cerr << "Sampling rate 64\n";
- for (unsigned int num = 0; num < 2; num ++){
-
- for (unsigned int i = 0; i < NWORDS ; i++){
-
- std::cerr << "\"" << words[i] << ": ";
- STARTTIMER();
- is = tc->IsContains((unsigned char*) words[i].c_str());
- STOPTIMER();
- time = GETTIME();
-
- std::cerr << is << ", " << time << ", ";
-
-
- STARTTIMER();
- count = tc->Count((unsigned char*) words[i].c_str());
- STOPTIMER();
- time = GETTIME();
-
- std::cerr << count << ", " << time << ", ";
-
-
- STARTTIMER();
- count = tc->CountContains((unsigned char*) words[i].c_str());
- STOPTIMER();
- time = GETTIME();
-
- std::cerr << count << ", " << time << ", ";
-
-
- STARTTIMER();
- res = tc->Contains((unsigned char*) words[i].c_str());
- STOPTIMER();
- time = GETTIME();
-
- std::cerr << time << "\n";
-
-
- };
- tc = tc2;
- std::cerr << "---------------------------\n";
- std::cerr << "Sampling rate 5\n";
- };
+
+
+ std::cerr << "Loading sf=5 TextCollection ";
+ STARTTIMER();
+ file = fopen("index_05.tc","r");
+ tc = TextCollection::Load(file,5); // sample rate is not used.
+ STOPTIMER();
+ time = GETTIME();
+ std::cerr << time << "ms, max_mem = " << get_mem() << "\n" ;
+ fclose(file);
+ std::cerr << "-----------------\nSampling rate 5\n";
+ time_tc(tc);
+ delete tc;
+ tc = NULL;
+ std::cerr << "Freeing memory : max_mem = " << get_mem() << "\n";
+
+ std::cerr << "Loading sf=64 TextCollection ";
+ STARTTIMER();
+ file = fopen("index_64.tc","r");
+ tc = TextCollection::Load(file,64);
+ STOPTIMER();
+ time = GETTIME();
+ std::cerr << time << "ms, max_mem = " << get_mem() << "\n" ;
+ fclose(file);
+ std::cerr << "-----------------\nSampling rate 64\n";
+ time_tc(tc);
+ delete tc;
+ tc = NULL;
+ std::cerr << "Freeing memory : max_mem = " << get_mem() << "\n";