From ea362186269eb7b3968cf3edfc16dc221c2e5827 Mon Sep 17 00:00:00 2001 From: bookug Date: Tue, 25 Oct 2016 15:10:52 +0800 Subject: [PATCH] print time in build process --- Database/Database.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Database/Database.cpp b/Database/Database.cpp index 852d5fc..501d55d 100644 --- a/Database/Database.cpp +++ b/Database/Database.cpp @@ -641,6 +641,7 @@ Database::build(const string& _rdf_file) //this->kvstore->release(); //cout<<"release kvstore"<kvstore)->open(); string _entry_file = this->getSignatureBFile(); @@ -648,6 +649,8 @@ Database::build(const string& _rdf_file) (this->vstree)->buildTree(_entry_file); long tv_build_end = Util::get_cur_time(); + + cout<<"after build vstree, used "<<(tv_build_end - before_vstree)<<"ms."<sub2id_pre2id_obj2id_RDFintoSignature(_rdf_file, _p_id_tuples, _id_tuples_max)) { return false; } + long t2 = Util::get_cur_time(); + cout<<"after encode, used "<<(t2-t1)<<"ms."<kvstore->id2* trees are closed this->stringindex->setNum(StringIndexFile::Entity, this->entity_num); this->stringindex->setNum(StringIndexFile::Literal, this->literal_num); @@ -923,10 +931,22 @@ Database::encodeRDF_new(const string _rdf_file) //this->s2p_s2po_sp2o(_p_id_tuples, _id_tuples_max); //NOTICE:we had better compute the corresponding triple num here this->s2p_s2o_s2po_sp2o(_p_id_tuples, _id_tuples_max); + + long t3 = Util::get_cur_time(); + cout<<"after s2xx, used "<<(t3-t2)<<"ms."<s2p_s2o_s2po_sp2o_sp2n(_p_id_tuples, _id_tuples_max); this->o2p_o2s_o2ps_op2s(_p_id_tuples, _id_tuples_max); + + long t4 = Util::get_cur_time(); + cout<<"after o2xx, used "<<(t4-t3)<<"ms."<o2p_o2s_o2ps_op2s_op2n(_p_id_tuples, _id_tuples_max); this->p2s_p2o_p2so(_p_id_tuples, _id_tuples_max); + + long t5 = Util::get_cur_time(); + cout<<"after p2xx, used "<<(t5-t4)<<"ms."<p2s_p2o_p2so_p2n(_p_id_tuples, _id_tuples_max); // //WARN:this is too costly because s-o key num is too large