Preallocate all possible PortVals.

The performance benefit is small (maybe ~1% at most), however, it's a
trivial change without downsides.
This commit is contained in:
Jon Siwek 2017-12-11 15:29:28 -06:00
parent 895e7b06b1
commit 1e4964de77
29 changed files with 139 additions and 68 deletions

View file

@ -87,6 +87,7 @@ int perftools_profile = 0;
DNS_Mgr* dns_mgr;
TimerMgr* timer_mgr;
PortManager* port_mgr = 0;
logging::Manager* log_mgr = 0;
threading::Manager* thread_mgr = 0;
input::Manager* input_mgr = 0;
@ -384,6 +385,7 @@ void terminate_bro()
delete plugin_mgr;
delete reporter;
delete iosource_mgr;
delete port_mgr;
reporter = 0;
}
@ -711,6 +713,7 @@ int main(int argc, char** argv)
bro_start_time = current_time(true);
port_mgr = new PortManager();
reporter = new Reporter();
thread_mgr = new threading::Manager();
plugin_mgr = new plugin::Manager();