projects
/
SXSI
/
TextCollection.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LZ index support
[SXSI/TextCollection.git]
/
testTextCollection.cpp
diff --git
a/testTextCollection.cpp
b/testTextCollection.cpp
index
166c019
..
82bf79e
100644
(file)
--- a/
testTextCollection.cpp
+++ b/
testTextCollection.cpp
@@
-40,14
+40,14
@@
int main()
int i = 0 ,j = 0;
int heap_base = HeapProfiler::GetHeapConsumption();
std::cerr << "Initial heap usage : " << heap_base << "\n";
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 = new TextCollectionBuilder(
5
);
heap_base = HeapProfiler::GetHeapConsumption ();
std::cerr << "Heap usage after InitTextCollection : " << heap_base << "\n";
Tools::StartTimer();
while (not(cin.eof())){
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;
data = (uchar *) str.c_str();
if (str.size() == 0)
continue;
@@
-86,14
+86,14
@@
int main()
std::cout << "over bounds" << std::endl;
delete [] temp;*/
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 << "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 << "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():
delete tcb; tcb = 0;
std::cerr << "After MakeStatic() [press enter]\n";
// This will print the maximum mem usage during MakeStatic():