1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-13 16:01:32 +03:00

MCOL-505 Performance improvements to ExeMgr

This fix improves the performance of ExeMgr by doing the following:

* Significantly reduces the amount of time the xml configuration is
scanned
* Uses a much faster way to determine the CPU core count
* Reduces the amount of times certain allocations are executed
* Rowgroup pre-allocates vectors for 1024 rows

This improves performance for the first query of a connection and the
performance for smaller result sets. It may well improve performance in
other areas too.
This commit is contained in:
Andrew Hutchings
2017-01-12 16:58:16 +00:00
parent ae630b3375
commit 2f3937ac7e
4 changed files with 37 additions and 44 deletions

View File

@ -32,6 +32,7 @@ using namespace std;
#include <boost/thread.hpp>
#include <boost/filesystem.hpp>
#include <boost/unordered_map.hpp>
using namespace boost;
namespace fs=boost::filesystem;
@ -82,8 +83,9 @@ Config* Config::makeConfig(const char* cf)
{
mutex::scoped_lock lk(fInstanceMapMutex);
string configFile;
string installDir = startup::StartUp::installDir();
static string installDir;
if (installDir.empty())
installDir = startup::StartUp::installDir();
if (cf == 0)
{
@ -96,18 +98,22 @@ Config* Config::makeConfig(const char* cf)
#endif
if (cf == 0 || *cf == 0)
{
fs::path configFilePath = fs::path(installDir) / fs::path("etc") / defaultCalpontConfigFile;
configFile = configFilePath.string();
}
else
{
configFile = cf;
static string defaultFilePath;
if (defaultFilePath.empty())
{
fs::path configFilePath;
configFilePath = fs::path(installDir) / fs::path("etc") / defaultCalpontConfigFile;
defaultFilePath = configFilePath.string();
}
if (fInstanceMap.find(defaultFilePath) == fInstanceMap.end())
{
Config* instance = new Config(defaultFilePath, installDir);
fInstanceMap[defaultFilePath] = instance;
}
return fInstanceMap[defaultFilePath];
}
}
else
{
configFile = cf;
}
string configFile(cf);
if (fInstanceMap.find(configFile) == fInstanceMap.end())
{
@ -241,7 +247,7 @@ const string Config::getConfig(const string& section, const string& name)
}
}
return fParser.getConfig(fDoc, section, name);
return fParser.getConfig(fDoc, section, name);
}
void Config::getConfig(const string& section, const string& name, vector<string>& values)