Switch Profiler off KTrie (bug 5884 part 6, r=ds).
This commit is contained in:
parent
ebe9ee8114
commit
0b8e2fd5c9
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* vim: set ts=4 :
|
* vim: set ts=4 sw=4 tw=99 noet :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
||||||
@ -465,7 +465,7 @@ void ProfileReport::SaveAtom(const prof_atom_t &atom)
|
|||||||
{
|
{
|
||||||
double atom_time;
|
double atom_time;
|
||||||
char full_name[256];
|
char full_name[256];
|
||||||
prof_atom_report_t **pReport, *report;
|
prof_atom_report_t *report;
|
||||||
|
|
||||||
if (atom.atom_type == SP_PROF_NATIVES)
|
if (atom.atom_type == SP_PROF_NATIVES)
|
||||||
{
|
{
|
||||||
@ -487,7 +487,7 @@ void ProfileReport::SaveAtom(const prof_atom_t &atom)
|
|||||||
|
|
||||||
atom_time = CalcAtomTime(atom);
|
atom_time = CalcAtomTime(atom);
|
||||||
|
|
||||||
if ((pReport = m_ReportLookup.retrieve(full_name)) == NULL)
|
if (!m_ReportLookup.retrieve(full_name, &report))
|
||||||
{
|
{
|
||||||
report = new prof_atom_report_t;
|
report = new prof_atom_report_t;
|
||||||
|
|
||||||
@ -502,8 +502,6 @@ void ProfileReport::SaveAtom(const prof_atom_t &atom)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
report = *pReport;
|
|
||||||
|
|
||||||
if (atom_time > report->max_time)
|
if (atom_time > report->max_time)
|
||||||
{
|
{
|
||||||
report->max_time = atom_time;
|
report->max_time = atom_time;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* vim: set ts=4 :
|
* vim: set ts=4 sw=4 tw=99 noet :
|
||||||
* =============================================================================
|
* =============================================================================
|
||||||
* SourceMod
|
* SourceMod
|
||||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
||||||
@ -34,9 +34,9 @@
|
|||||||
|
|
||||||
#include <sp_vm_api.h>
|
#include <sp_vm_api.h>
|
||||||
#include <sm_platform.h>
|
#include <sm_platform.h>
|
||||||
#include <sm_trie_tpl.h>
|
|
||||||
#include <sh_vector.h>
|
#include <sh_vector.h>
|
||||||
#include <sh_stack.h>
|
#include <sh_stack.h>
|
||||||
|
#include <sm_namehashset.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "common_logic.h"
|
#include "common_logic.h"
|
||||||
#include <IRootConsoleMenu.h>
|
#include <IRootConsoleMenu.h>
|
||||||
@ -72,6 +72,11 @@ struct prof_atom_report_t
|
|||||||
unsigned int num_calls; /* Number of invocations */
|
unsigned int num_calls; /* Number of invocations */
|
||||||
double min_time; /* Min time spent in one call, in s */
|
double min_time; /* Min time spent in one call, in s */
|
||||||
double max_time; /* Max time spent in one call, in s */
|
double max_time; /* Max time spent in one call, in s */
|
||||||
|
|
||||||
|
static inline bool matches(const char *name, const prof_atom_report_t *report)
|
||||||
|
{
|
||||||
|
return strcmp(report->atom_name, name) == 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProfileReport
|
class ProfileReport
|
||||||
@ -84,7 +89,7 @@ public:
|
|||||||
prof_atom_report_t *GetReport(size_t i);
|
prof_atom_report_t *GetReport(size_t i);
|
||||||
void Clear();
|
void Clear();
|
||||||
private:
|
private:
|
||||||
KTrie<prof_atom_report_t *> m_ReportLookup;
|
NameHashSet<prof_atom_report_t *> m_ReportLookup;
|
||||||
CVector<prof_atom_report_t *> m_Reports;
|
CVector<prof_atom_report_t *> m_Reports;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user