refactor: forbidden ccache and change static double for int

by zengli, no influence on others
This commit is contained in:
bookug 2017-04-13 22:18:14 +08:00
parent 2c5ef57fe4
commit 13204bcd3f
5 changed files with 15 additions and 8 deletions

View File

@ -132,7 +132,9 @@ Join::judge(int _smallest, int _biggest)
//BETTER:how to guess the size of can_lists
double size = (_smallest + _biggest) / 2.0;
double ans = Join::PARAM_DENSE * dense - size / Join::PARAM_SIZE;
if (ans > Join::JUDGE_LIMIT)
double limit = 1.0 / (double)Join::JUDGE_LIMIT;
//if (ans > Join::JUDGE_LIMIT)
if (ans > limit)
return 0; //multi_join method
else
return 1; //index_join method

View File

@ -55,8 +55,12 @@ private:
static const unsigned PARAM_SIZE = 1000000;
static const unsigned PARAM_PRE = 10000;
static const unsigned PARAM_DENSE = 1;
static const double JUDGE_LIMIT = 0.5;
//constexpr needed in C++11 (or in newer g++)
//static const double JUDGE_LIMIT = 0.5;
static const int JUDGE_LIMIT = 2; //use 1.0/JUDGE_LIMIT
static const int LIMIT_CANDIDATE_LIST_SIZE = 1000;
//BETTER?:predefine size to avoid copy cost
TableType current_table;
TableIterator new_start; //keep to end() as default

View File

@ -1,5 +1,5 @@
#CC=g++
CC=ccache g++
CC=g++
#CC=ccache g++
example: CppAPIExample.o
$(CC) -o example CppAPIExample.o -L../lib -lgstoreconnector

View File

@ -1,5 +1,5 @@
#CC=g++
CC=ccache g++
CC=g++
#CC=ccache g++
lib_dir=../lib/
socket_obj_dir=../../../.objs/

View File

@ -35,8 +35,9 @@
#compile parameters
CC = ccache g++
#CC = g++
# WARN: maybe difficult to install ccache in some systems
#CC = ccache g++
CC = g++
#the optimazition level of gcc/g++
#http://blog.csdn.net/hit_090420216/article/details/44900215