Crossfire Server, Trunk
perf_mapload.c
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
main
int main(int argc, char *argv[])
Definition: perf_mapload.c:7
MAP_PLAYER_UNIQUE
#define MAP_PLAYER_UNIQUE
Definition: map.h:97
flags
static const flag_definition flags[]
Definition: gridarta-types-convert.c:101
settings
struct Settings settings
Definition: init.c:39
m
static event_registration m
Definition: citylife.cpp:427
Settings::debug
LogLevel debug
Definition: global.h:239
mapdef
Definition: map.h:317
make_face_from_files.int
int
Definition: make_face_from_files.py:26
init_library
void init_library(void)
Definition: init.c:192
llevDebug
@ llevDebug
Definition: logger.h:13
mapfile_load
mapstruct * mapfile_load(const char *map, int flags)
Definition: map.c:1214