Crossfire Server, Trunk
perf_mapload.cpp
Go to the documentation of this file.
1 #include "global.h"
2 
3 #ifdef HAVE_GPERFTOOLS_PROFILER_H
4 #include <gperftools/profiler.h>
5 #endif
6 
7 int main(int argc, char *argv[]) {
8  if (argc < 3) {
9  puts("usage: perf_mapload PATH N_TIMES");
10  return 0;
11  }
12 
14  init_library();
15  int flags = 0;
16  if (argv[1][0] == '~') {
18  }
19 #ifdef HAVE_GPERFTOOLS_PROFILER_H
20  ProfilerStart("mapload.prof");
21 #endif
22  for (int i = 0; i < (int)strtol(argv[2], NULL, 10); i++) {
23  mapstruct *m = mapfile_load(argv[1], flags);
24  if (m == NULL) {
25  break;
26  }
27  // free_map() before save_map() is extremely slow, don't profile this
28  //free_map(m);
29  }
30 #ifdef HAVE_GPERFTOOLS_PROFILER_H
31  ProfilerStop();
32 #endif
33 }
global.h
settings
struct Settings settings
Definition: init.cpp:139
main
int main(int argc, char *argv[])
Definition: perf_mapload.cpp:7
flags
static const flag_definition flags[]
Definition: gridarta-types-convert.cpp:101
MAP_PLAYER_UNIQUE
#define MAP_PLAYER_UNIQUE
Definition: map.h:92
m
static event_registration m
Definition: citylife.cpp:425
Settings::debug
LogLevel debug
Definition: global.h:243
init_library
void init_library(void)
Definition: init.cpp:324
mapstruct
Definition: map.h:313
make_face_from_files.int
int
Definition: make_face_from_files.py:32
mapfile_load
mapstruct * mapfile_load(const char *map, int flags)
Definition: map.cpp:1216
llevDebug
@ llevDebug
Definition: logger.h:13