int i = 0 ,j = 0;
int heap_base = HeapProfiler::GetHeapConsumption();
std::cerr << "Initial heap usage : " << heap_base << "\n";
- TextCollectionBuilder *tcb = new TextCollectionBuilder(32);
+ TextCollectionBuilder *tcb = TextCollectionBuilder::create(5);
heap_base = HeapProfiler::GetHeapConsumption ();
std::cerr << "Heap usage after InitTextCollection : " << heap_base << "\n";
Tools::StartTimer();
while (not(cin.eof())){
- getline(cin,str); // Read line by line.
-// cin >> str; // Read word by word.
+ getline(cin,str); // Read line by line.
+// cin >> str; // Read word by word.
data = (uchar *) str.c_str();
if (str.size() == 0)
continue;
std::cout << "over bounds" << std::endl;
delete [] temp;*/
- HeapProfiler::ResetMaxHeapConsumption();
std::cerr << "Creating new text collection with " << i << " strings (total " << j/1024 << " kb)\n";
+ std::cerr << "max heap usage: " << HeapProfiler::GetMaxHeapConsumption()/(1024*1024) << " Mbytes" << std::endl;
+ HeapProfiler::ResetMaxHeapConsumption();
std::cerr << "Before MakeStatic() [press enter]\n";
//std::cin >> kbd;
// This will print the maximum mem usage during construction time:
- std::cerr << "max heap usage: " << HeapProfiler::GetMaxHeapConsumption()/(1024*1024) << " Mbytes" << std::endl;
- TextCollection* tc = tcb->InitTextCollection();
+ TextCollection* tc = tcb->InitTextCollection();//SXSI::TextStorage::TYPE_LZ_INDEX);
delete tcb; tcb = 0;
std::cerr << "After MakeStatic() [press enter]\n";
// This will print the maximum mem usage during MakeStatic():