{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/xgboost/issues/552","labels_url":"https://api.github.com/repos/dmlc/xgboost/issues/552/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/xgboost/issues/552/comments","events_url":"https://api.github.com/repos/dmlc/xgboost/issues/552/events","html_url":"https://github.com/dmlc/xgboost/pull/552","id":112235492,"number":552,"title":"GBTree::Predict performance fix: removed excess thread_temp initializ…","user":{"login":"yoori","id":15192893,"avatar_url":"https://avatars.githubusercontent.com/u/15192893?v=3","gravatar_id":"","url":"https://api.github.com/users/yoori","html_url":"https://github.com/yoori","followers_url":"https://api.github.com/users/yoori/followers","following_url":"https://api.github.com/users/yoori/following{/other_user}","gists_url":"https://api.github.com/users/yoori/gists{/gist_id}","starred_url":"https://api.github.com/users/yoori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoori/subscriptions","organizations_url":"https://api.github.com/users/yoori/orgs","repos_url":"https://api.github.com/users/yoori/repos","events_url":"https://api.github.com/users/yoori/events{/privacy}","received_events_url":"https://api.github.com/users/yoori/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-19T21:20:00Z","updated_at":"2015-10-22T15:41:07Z","closed_at":"2015-10-22T15:39:05Z","pull_request":{"url":"https://api.github.com/repos/dmlc/xgboost/pulls/552","html_url":"https://github.com/dmlc/xgboost/pull/552","diff_url":"https://github.com/dmlc/xgboost/pull/552.diff","patch_url":"https://github.com/dmlc/xgboost/pull/552.patch"},"body":"I use BoostLearner::Predict in c++ code on gbtree model with big number of features (16M)\r\nBoostLearner::Predict give bad performance in case when I call BoostLearner::Predict for small data portion\r\nMy research show that bottleneck in GBTree::Predict function:\r\n```\r\n thread_temp.resize(nthread, tree::RegTree::FVec());\r\n    for (int i = 0; i < nthread; ++i) {\r\n      thread_temp[i].Init(mparam.num_feature);\r\n    }\r\n```\r\nFVec::Init call std::fill (16 Mb of float's in my case).\r\nIt seems possible to remove excess initialization of thread_temp on each call, because GBTree::Pred revert changed FVec values:\r\n```\r\n    if (itop != trees.size()) {\r\n      p_feats->Fill(inst);\r\n      ….\r\n      p_feats->Drop(inst);\r\n    }\r\n```\r\nApplied next changes: BoostLearner::Predict and BoostLearner::PredictLeaf initialize thread_temp only on first call or on OMP thread pool extending.\r\nIt helped to me, now on one CPU core (Intel(R) Xeon® CPU X5650  @ 2.67GHz, OMP disabled) BoostLearner::Predict give 625000 calls/sec (without patch it give: 120 calls/sec)\r\n\r\nM.b it will help someone"},"comment":{"url":"https://api.github.com/repos/dmlc/xgboost/issues/comments/150266195","html_url":"https://github.com/dmlc/xgboost/pull/552#issuecomment-150266195","issue_url":"https://api.github.com/repos/dmlc/xgboost/issues/552","id":150266195,"user":{"login":"tqchen","id":2577440,"avatar_url":"https://avatars.githubusercontent.com/u/2577440?v=3","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T15:41:07Z","updated_at":"2015-10-22T15:41:07Z","body":"I have added you to the https://github.com/dmlc/xgboost/blob/master/CONTRIBUTORS.md Please feel free to push changes of your information, or more things you like to improve xgboost"}}