profile package open timing

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1541 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-12-07 21:14:10 +00:00
parent 8d830289a7
commit f9e8bb88e3
+3
View File
@@ -11,6 +11,7 @@
#include <util/io/package_manager.hpp>
#include <util/error.hpp>
#include <script/to_value.hpp> // for reflection
#include <script/profiler.hpp> // for PROFILER
#include <wx/wfstream.h>
#include <wx/zipstrm.h>
#include <wx/dir.h>
@@ -68,6 +69,7 @@ const String& Package::absoluteFilename() const {
void Package::open(const String& n, bool fast) {
assert(!isOpened()); // not already opened
PROFILER(_("open package"));
// get absolute path
wxFileName fn(n);
fn.Normalize();
@@ -534,6 +536,7 @@ template <> void Reader::handle(JustAsPackageProxy& object) {
void Packaged::open(const String& package, bool just_header) {
Package::open(package);
fully_loaded = false;
PROFILER(just_header ? _("open package header") : _("open package fully"));
if (just_header) {
// Read just the header (the part common to all Packageds)
Reader reader(openIn(typeName()), this, absoluteFilename() + _("/") + typeName(), true);