| 1 | Favorite campaigns: |
|---|
| 2 | ------------------- |
|---|
| 3 | Ooze Mini-Campaign |
|---|
| 4 | Dead Water - really hard |
|---|
| 5 | Invasion of the Unknown |
|---|
| 6 | Brotherhood of Light |
|---|
| 7 | World Conquest |
|---|
| 8 | A New Order (?) |
|---|
| 9 | Wesband |
|---|
| 10 | |
|---|
| 11 | Favorite Eras: |
|---|
| 12 | -------------- |
|---|
| 13 | Ageless |
|---|
| 14 | Age of Heroes |
|---|
| 15 | Era of Myths |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | with pool_alloc |
|---|
| 23 | 43.49mb, 155.21mb vm |
|---|
| 24 | 3:32 until main menu |
|---|
| 25 | |
|---|
| 26 | without pool_alloc: |
|---|
| 27 | a little bit slower, but much less memory used |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | - really need to "re-initialize fonts for the current language"? NO |
|---|
| 31 | - convert file streams to memory streams |
|---|
| 32 | - do not use gzip to cache |
|---|
| 33 | - cache differences to main set only, not the whole thing |
|---|
| 34 | - split out terrain, units, help |
|---|
| 35 | - only load unit/terrain cfg as they are required |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | DATA/_main.cfg |
|---|
| 41 | themes/ |
|---|
| 42 | default.cfg |
|---|
| 43 | core/ |
|---|
| 44 | core/macros/ -- a lot of gameplay wml |
|---|
| 45 | core/help.cfg -- the help system, a LOT of text |
|---|
| 46 | core/terrain.cfg |
|---|
| 47 | core/terrain-graphics/ -- lots of files |
|---|
| 48 | core/units.cfg -- a TON of files in here... |
|---|
| 49 | multiplayer/ |
|---|
| 50 | multiplayer/scanarios/ |
|---|
| 51 | multiplayer/eras.cfg |
|---|
| 52 | campaigns/ -- just to load the campaign info |
|---|
| 53 | core/terrain-graphics.cfg |
|---|
| 54 | game_config.cfg |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | Baseline profile: |
|---|
| 60 | Took 24709 ms to read gui/default.cfg file (release mode) |
|---|
| 61 | Took 383 ms to save gui config to archive |
|---|
| 62 | |
|---|
| 63 | Starting config_cache::read_file() at 127960 ticks |
|---|
| 64 | Ended config_cache::read_file() at 208941 ticks (80981 ms) |
|---|
| 65 | Took 23202 ms to save game config to archive. |
|---|
| 66 | Took 44795 ms to load game config from archive. (3mb file) |
|---|
| 67 | |
|---|
| 68 | -> converting to memory stream == no difference (file is read in very quickly) |
|---|
| 69 | -> disabling loading screen progress bar == no difference |
|---|
| 70 | -> compile in release mode == 53834 ms |
|---|
| 71 | -> remove try/catch in parser loop == 66101 ms ... |
|---|
| 72 | -> disable c++ exceptions in compiler == doesn't work (boost exceptions needed) |
|---|
| 73 | -> decompress in one step == |
|---|
| 74 | -> turn off DEBUG and DEBUG_ERROR preprocessor defines == |
|---|
| 75 | |
|---|
| 76 | Time Profiling, from start to main menu: |
|---|
| 77 | 40980ms tokenizer::next_token() |
|---|
| 78 | - seems to be slow std::basic_string functions like reserve, assign |
|---|
| 79 | std::basic_istream::get() - |
|---|
| 80 | |
|---|
| 81 | -> rewrote tokenizer::next_token() to use char buffers == 33708 ms |
|---|
| 82 | |
|---|
| 83 | New profile data: |
|---|
| 84 | |
|---|
| 85 | Took 24570 ms to read gui/default.cfg file. |
|---|
| 86 | Took 387 ms to save gui config to archive. |
|---|
| 87 | Starting config_cache::read_file() at 30863 ticks |
|---|
| 88 | Ended config_cache::read_file() at 66876 ticks (36013ms) |
|---|
| 89 | time elapsed: 78126 ms |
|---|
| 90 | |
|---|
| 91 | ms function |
|---|
| 92 | 19500 tokenizer::next_token() |
|---|
| 93 | 12630 parser::parse_variable() |
|---|
| 94 | 7510 preprocessor_data::get_chunk() |
|---|
| 95 | 6790 tokenizer::skip_comment() |
|---|
| 96 | |
|---|
| 97 | -> removed text domains from tokenizer::skip_comment() |
|---|
| 98 | |
|---|
| 99 | Took 16783 ms to read gui/default.cfg file. |
|---|
| 100 | Took 371 ms to save gui config to archive. |
|---|
| 101 | Starting config_cache::read_file() at 22835 ticks |
|---|
| 102 | Ended config_cache::read_file() at 53222 ticks (30387ms) |
|---|
| 103 | time elapsed: 63539 ms |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | -> preprocessed gui/default.cfg == Took 2797 ms to read gui/default.cfg file |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | -> create custom binary cfg cache file system, with key, value tables |
|---|
| 111 | n x [key index], [value index] |
|---|
| 112 | n x [children cfgs] |
|---|
| 113 | n x [key strings] |
|---|
| 114 | n x [value strings] |
|---|
| 115 | |
|---|
| 116 | to create data tree, just point to key/value table in memory |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | BUT it is complicated to create string tables |
|---|
| 120 | |
|---|
| 121 | config::saveCache() |
|---|
| 122 | short numKeys |
|---|
| 123 | numKeys x key, value (pascal style strings: length, then the char data) |
|---|
| 124 | short numChildren |
|---|
| 125 | numChildren x names |
|---|
| 126 | [recursive child data] |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | Took 827 ms to read cached file /var/mobile/Applications/948A4D67-11FC-4172-8862-2F37989D1D0E/wesnoth.app/data/gui/gui.cached.cfg |
|---|
| 131 | Took 10306 ms to read cached file /private/var/mobile/Applications/948A4D67-11FC-4172-8862-2F37989D1D0E/Documents/wesnoth1.6/cache/cache-v1.6.3-a76d6f857c35047c0a634eb329e1338b653fcea2.cache.cfg |
|---|
| 132 | time elapsed: 33771 ms |
|---|
| 133 | |
|---|
| 134 | -> use minimal .cfg to launch |
|---|
| 135 | |
|---|
| 136 | time elapsed: 7736 ms |
|---|
| 137 | |
|---|
| 138 | 24.8% 1400ms GLES_RenderCopy -> glTexSubImage2D |
|---|
| 139 | |
|---|
| 140 | -> fixed loading screen not to update whole screen... |
|---|
| 141 | |
|---|
| 142 | ---------- |
|---|
| 143 | |
|---|
| 144 | Optimizing game loading... |
|---|
| 145 | |
|---|
| 146 | 3:28 to load tutorial... |
|---|
| 147 | |
|---|
| 148 | terrain_builder::rotate_rule() 51800ms, 37.1% |
|---|
| 149 | |
|---|
| 150 | -> cache terrain_builder output?? .. but sometimes terrain can change from saved games? |
|---|
| 151 | -> okay to cache "terrain_builder::building_rules_" as this is loaded from the cfg, BUT it can change for every campaign |
|---|
| 152 | |
|---|
| 153 | -> add recursive cache saving, starting from |
|---|
| 154 | terrain_builder: building_ruleset building_rules_; |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | 39740ms to load tutorial |
|---|
| 158 | |
|---|
| 159 | ------------- |
|---|
| 160 | |
|---|
| 161 | -> build string table system for cache, to reduce size and speed up loading |
|---|
| 162 | -> much smaller, but still same load time... use c strings to avoid std::string overhead? |
|---|
| 163 | DONE |
|---|
| 164 | |
|---|
| 165 | Optimizing game draw speed... |
|---|
| 166 | |
|---|
| 167 | 3fps |
|---|
| 168 | 32.6% GLES_RenderCopy |
|---|
| 169 | |
|---|
| 170 | -> check openGL texture format |
|---|
| 171 | 32 bit SDL_PIXELFORMAT_ABGR8888 |
|---|
| 172 | format = GL_RGBA 6408 |
|---|
| 173 | formattype = GL_UNSIGNED_BYTE 5121 |
|---|
| 174 | |
|---|
| 175 | -> optimize full-screen update by just recreating the texture |
|---|
| 176 | CAN'T, the texture is 512x512, not 480x320 |
|---|
| 177 | -> use 512x512 pixel buffer, and recreate texture each time it is updated |
|---|
| 178 | |
|---|
| 179 | 5fps, still most of time in GLES_RenderCopy |
|---|
| 180 | |
|---|
| 181 | |
|---|
| 182 | -> upgrade to proper SDL 1.3 using SDL_TEXTURE instead of surfaces |
|---|
| 183 | DONE |
|---|
| 184 | |
|---|
| 185 | terrain graphics: 72x72 = 14x14 tiles in cache = 196 tiles |
|---|
| 186 | unit graphics |
|---|
| 187 | interface |
|---|
| 188 | can still keep some stuff as surfaces, such as dialogs? |
|---|
| 189 | 24mb texture limit... 4mb per 1024x1024 = 6 pages |
|---|
| 190 | game should be under 20mb runtime memory too |
|---|
| 191 | |
|---|
| 192 | implement automatic surface->texture generation and cache |
|---|
| 193 | DONE |
|---|
| 194 | |
|---|
| 195 | how to do clipping in opengl??? |
|---|
| 196 | fix clip_rect_setter, clip src rect, dst rect |
|---|
| 197 | DONE |
|---|
| 198 | |
|---|
| 199 | automatically cache textures but encapsulating it in surface structure, |
|---|
| 200 | that stores both SDL_Surface and SDL_TextureID |
|---|
| 201 | DONE |
|---|
| 202 | |
|---|
| 203 | font::draw_text is slow... It has to convert the surfaces to create the cached texture |
|---|
| 204 | should we cache the character output from SDL_TTF and render char by char? that would be very quick |
|---|
| 205 | DONE -> implemented text cache, but check neutral_surface_format -> ABGR888 |
|---|
| 206 | |
|---|
| 207 | huge amount of memory churn every frame... should be using pointers instead of passing everything by reference... |
|---|
| 208 | |
|---|
| 209 | memory required and time to load terrain is very large, way to cache only what is needed for the level?? |
|---|
| 210 | currently it caches building_ruiles_ only... can we cache tile_map_ directly for each level? |
|---|
| 211 | |
|---|
| 212 | 26mb to get to tutorial, but churns through 334mb! |
|---|
| 213 | |
|---|
| 214 | |
|---|
| 215 | changing openGL states is expensive! cache the state... |
|---|
| 216 | DONE |
|---|
| 217 | |
|---|
| 218 | was drawing a fullscreen background each time which was overdrawn by the map |
|---|
| 219 | DONE |
|---|
| 220 | |
|---|
| 221 | to avoid constant texture binding, create 1024x1024 hex graphic cache, 14x14 72x72 = 196 tiles |
|---|
| 222 | LRU cache using lists, when a tile is drawn, it gets moved to the end of the list. Remove the head entry if needed |
|---|
| 223 | DONE |
|---|
| 224 | |
|---|
| 225 | |
|---|
| 226 | Pretty fast on device now, scrolls around tutorial quickly! |
|---|
| 227 | 10mb texture use, 11-15fps |
|---|
| 228 | |
|---|
| 229 | BUT cache miss stalls fps. Need to precache when map loaded. This will also avoid long black screen before map is displayed |
|---|
| 230 | Count how many cache entries are required, have two texture pages |
|---|
| 231 | See if avoiding same-texture binding speeds things up |
|---|
| 232 | |
|---|
| 233 | Change cache system to speed game loading (after initial setup) |
|---|
| 234 | -> load full base config at start |
|---|
| 235 | -> load cfg diff's for each level |
|---|
| 236 | -> what about terrain? it takes too long to parse the building rules... need a building rule diff system too... |
|---|
| 237 | |
|---|
| 238 | |
|---|
| 239 | new profiling data after changing string loading (with mempool on) |
|---|
| 240 | -> startup |
|---|
| 241 | Took 50 ms to read tips cache |
|---|
| 242 | took 1089 ms to read gui cache |
|---|
| 243 | took 94ms to read minimal launch cache |
|---|
| 244 | startup in 9961ms |
|---|
| 245 | |
|---|
| 246 | -> load tutorial |
|---|
| 247 | took 10139ms to read TUTORIAL defined cache |
|---|
| 248 | -> check if this includes help, terrain?? YES it still includes terrain... |
|---|
| 249 | took 3380ms to load help cache |
|---|
| 250 | took 23006ms to load terrain cache |
|---|
| 251 | done initializing managers... 30251 |
|---|
| 252 | |
|---|
| 253 | |
|---|
| 254 | hmmm... they say file access is slow... is it slower than loading in a gzip version and uncompressing in memory? let's test that theory... |
|---|
| 255 | IMPLEMENT GZIP -> Time to load in 3mb file: 174ms. Time to load 88k compressed version and decompress: 6ms. The time variance is insignificant, but space savings is well worth it. PLUS there may be slowdowns with the current system that streams the file in a few bytes at a time... It is more like 614ms |
|---|
| 256 | DONE |
|---|
| 257 | |
|---|
| 258 | sometimes the original image source is changed, eg to fade in a recruited unit. In this case, the cache needs to be invalidated! |
|---|
| 259 | DONE on surface.assign() |
|---|
| 260 | |
|---|
| 261 | 5s in game_controller::set_unit_data() -> cache this? |
|---|
| 262 | 3s to load help cache, which isn't needed at this point! from play_controller::init(CVideo&) |
|---|
| 263 | DONE |
|---|
| 264 | pre-allocate space with vector.reserve() to avoid memory thrashing? **** |
|---|
| 265 | DONE |
|---|
| 266 | instead of map[key]=value, use map.insert(std::pair<key, value>) **** |
|---|
| 267 | DONE |
|---|
| 268 | 16740ms in terrain_builder::loadCache() |
|---|
| 269 | |
|---|
| 270 | new profiling data: |
|---|
| 271 | -> startup |
|---|
| 272 | took 89ms to read fonts |
|---|
| 273 | took 43ms to read tips |
|---|
| 274 | took 713 ms to read gui |
|---|
| 275 | took 92ms to read minimal launch cache |
|---|
| 276 | startup in 9087ms |
|---|
| 277 | |
|---|
| 278 | -> load tutorial |
|---|
| 279 | took 10256ms to read TUTORIAL cache |
|---|
| 280 | took 28575ms to load terrain cache |
|---|
| 281 | done initializing managers... 32417 |
|---|
| 282 | |
|---|
| 283 | |
|---|
| 284 | memory mapped IO? NOT NEEDED |
|---|
| 285 | make sure computed path is cached YES |
|---|
| 286 | |
|---|
| 287 | to optimize many small allocations of the same object of a fixed size, try using boost.pool allocator std::vector<int, boost::pool_allocator<int> > v; |
|---|
| 288 | unordered sets can perform much faster than ordered maps, eg use boost::unordered_map<std::string, int> map(10000); |
|---|
| 289 | |
|---|
| 290 | make new functions for blit_reversed and blit with color/tint/alpha, to minimize image cache |
|---|
| 291 | |
|---|
| 292 | use string table for config objects in memory, will speed up loading as well as reduce memory requirements |
|---|
| 293 | DONE with StringPool class |
|---|
| 294 | |
|---|
| 295 | hide initial loading by using splash screens? or intro sequence? or start loading in the background in a separate thread |
|---|
| 296 | use defines map "/data APPLE TINY" and diffs |
|---|
| 297 | cache-v1.6.3-6d8ff741cd1977c76142eb886aa787f8724a0f90.dat with defines_map /data APPLE TINY TUTORIAL' |
|---|
| 298 | cache-v1.6.3-59a3187d5a962426ea99174ccd72f2aad6324e89.dat with defines_map /data/minimal_launch.cfg APPLE TINY' |
|---|
| 299 | |
|---|
| 300 | |
|---|
| 301 | waiting to load after a map entry is inserted: |
|---|
| 302 | took 13643ms to read terrain cache |
|---|
| 303 | done initializing managers... 18045 |
|---|
| 304 | |
|---|
| 305 | use pool allocators for strings: |
|---|
| 306 | #include <boost/pool/pool_alloc.hpp> |
|---|
| 307 | typedef std::basic_string<char, std::char_traits<char>, boost::fast_pool_allocator<char> > String; |
|---|
| 308 | |
|---|
| 309 | |
|---|
| 310 | using gcc mt allocator: |
|---|
| 311 | took 9505ms to read terrain cache |
|---|
| 312 | done initializing managers... 14344 |
|---|
| 313 | |
|---|
| 314 | |
|---|
| 315 | |
|---|
| 316 | Campaigns: |
|---|
| 317 | 190 levels in main-line campaigns |
|---|
| 318 | almost 300 levels in user-made addon campaigns |
|---|
| 319 | |
|---|
| 320 | |
|---|
| 321 | portrait images: 400x400 => 176x176 |
|---|
| 322 | |
|---|
| 323 | REMEMBER TO USE PNG OPTIMIZATION PROGRAM!!! |
|---|
| 324 | |
|---|
| 325 | |
|---|
| 326 | Remove translations ^ |
|---|
| 327 | ability,traits: female_name |
|---|
| 328 | unit config: name |
|---|
| 329 | map config: user_team_name |
|---|
| 330 | DONE |
|---|
| 331 | |
|---|
| 332 | |
|---|
| 333 | TODO: |
|---|
| 334 | cache openGL renders, to sort by texture? |
|---|
| 335 | or always render to texture or a way to get the render buffer to scroll?? |
|---|
| 336 | |
|---|
| 337 | |
|---|
| 338 | |
|---|
| 339 | |
|---|
| 340 | |
|---|
| 341 | |
|---|
| 342 | need memory reduction |
|---|
| 343 | --------------------- |
|---|
| 344 | |
|---|
| 345 | 30mb to get to tutorial |
|---|
| 346 | creating textures counts against app memory? eg 1024x1024 streaming texture = 4mb for texture + 4mb for surface bits :( |
|---|
| 347 | SO create pixels during pre-cache phase, then create textures and free pixels |
|---|
| 348 | fullscreen image 480x320 = 614400 bytes. So make sure to clear loadscreen image! |
|---|
| 349 | at 7.5s in, a std::vector<int> took up 966656 bytes! |
|---|
| 350 | DONE - was the font codepoints |
|---|
| 351 | soooo many strings are 4096 bytes... !!! like 1500 strings = 6mb!!! wtf! |
|---|
| 352 | -> create new lightweight string class |
|---|
| 353 | std::vector<image::cache_item<surface>> is taking up lots of memory |
|---|
| 354 | -> well, it's the cached surfaces, duhhh |
|---|
| 355 | SDL_CreateRGBSurface or course has tons of objects |
|---|
| 356 | |
|---|
| 357 | try again using memory pool at 30mb |
|---|
| 358 | -> no difference in memory?? |
|---|
| 359 | get rid of font cfg after it is loaded in? |
|---|
| 360 | we do not really need font::font_map, font::split_text() functions... |
|---|
| 361 | DONE |
|---|
| 362 | |
|---|
| 363 | instead of brightening tile, use a white alpha tile brighten.png |
|---|
| 364 | |
|---|
| 365 | cached building rules aren't really working... it's like they're out of order or something... |
|---|
| 366 | OR it seems like a problem with cached images... |
|---|
| 367 | checking code indicates a problem with image locator function... the filename is correct, but returned image is different |
|---|
| 368 | FIXED - added init_index() call to locator loadCache |
|---|
| 369 | default to turn web stats OFF |
|---|
| 370 | |
|---|
| 371 | instead of caching all tiles, loop through and cache the 196 most-used tiles to one texture map |
|---|
| 372 | |
|---|
| 373 | using new string class: |
|---|
| 374 | took 4266 ms to read tutorial cache |
|---|
| 375 | took 9170ms to read terrain cache |
|---|
| 376 | done initializing managers... 12444 |
|---|
| 377 | |
|---|
| 378 | 22mb to get to tutorial |
|---|
| 379 | |
|---|
| 380 | terrain memory reduction: |
|---|
| 381 | |
|---|
| 382 | - use rotate flags to reuse edge tiles |
|---|
| 383 | - use pvrtc compression: |
|---|
| 384 | texturetool -e PVRTC --channel-weighting-linear --bits-per-pixel-4 -o test2.pvrtc -p test2_p.png test2.png |
|---|
| 385 | memory from png: 72x72x4 = 20k... memory from pvrtc: 128x128/2 = 8k (only 40% of original!) |
|---|
| 386 | BUT we still need texture maps... so group logical tiles together into maps |
|---|
| 387 | base full-hex tiles still need to be in a png, since it needs to tile, however the overlays are fine if there are compression artifacts |
|---|
| 388 | 1 = 128x128, |
|---|
| 389 | 3x3 (9) = 256x256, 10 pixel spacers |
|---|
| 390 | 6x6 (36) = 512x512, 10 pixel spacers. 1mb uncompressed, vs ... 131k compressed!!! |
|---|
| 391 | 13x13(169) = 1024x1024, 6 pixel spacers = 4mb vs 524k compressed = only 12.5% of the uncompressed, or savings of 87.5% !!! |
|---|
| 392 | |
|---|
| 393 | too bad we can't use it on units... units need to be palette swapped for team color... |
|---|
| 394 | actually......... we can afford to pre-color the units to avoid the need for palette swapping! how many colors are needed? |
|---|
| 395 | 9 colors: red, blue, green, purple, black, brown, orange, white, teal |
|---|
| 396 | this will decrease runtime memory required |
|---|
| 397 | ughhh... castle tiles are NOT 72x72, but much bigger and various sizes... but at least we should trim them to minimum size... |
|---|
| 398 | DONE |
|---|
| 399 | |
|---|
| 400 | fix help images to use different terrain tiles |
|---|
| 401 | minimap rendering won't work with new terrain tile system... replace with known color for each tile type? |
|---|
| 402 | |
|---|
| 403 | |
|---|
| 404 | after implementing texture atlases: |
|---|
| 405 | without pool_alloc: |
|---|
| 406 | 16mb texture memory |
|---|
| 407 | but 46mb real memory?? 13.7mb of 16 byte allocations (most from strings), 8mb of 1024x1024 texture?? |
|---|
| 408 | 6fps |
|---|
| 409 | |
|---|
| 410 | with pool_alloc: |
|---|
| 411 | 18mb net bytes... the 1024x1024 allocations were freed after awhile <phew> |
|---|
| 412 | most memory in 32 byte allocations... for the map entries |
|---|
| 413 | |
|---|
| 414 | implemented new/delete using pool_alloc, but then all memory is hidden in the object alloc tool. |
|---|
| 415 | SO it is better to just use the built-in memory routines, as these are pooled anyways... |
|---|
| 416 | and look to the "memory monitor" for the real memory usage of the app |
|---|
| 417 | |
|---|
| 418 | SO: we have a lot of room left in texture memory... we should convert more surfaces to use native textures, if possible |
|---|
| 419 | like the GUI... |
|---|
| 420 | |
|---|
| 421 | implement terrain render queue and sort by texture to improve performance. turn on z-buffer |
|---|
| 422 | can't use z-buffer with transparent textures... just sort by layer, then texture |
|---|
| 423 | |
|---|
| 424 | use a memory profiling tool to check memory usage |
|---|
| 425 | use more pooled strings, maybe for terrain builder or image locator? check tod variance for image locator |
|---|
| 426 | can we free cfg memory after it is parsed? like terrain, units: game_config_.clear_children("terrain_graphics"); |
|---|
| 427 | NOT units, it is checked |
|---|
| 428 | use compressed textures for story screens, portrait pics |
|---|
| 429 | |
|---|
| 430 | at tutorial finished loading: |
|---|
| 431 | ------------------------------------------------ |
|---|
| 432 | MALLOC: 36560896 ( 34.9 MB) Heap size |
|---|
| 433 | MALLOC: 30969360 ( 29.5 MB) Bytes in use by application |
|---|
| 434 | MALLOC: 3993600 ( 3.8 MB) Bytes free in page heap |
|---|
| 435 | MALLOC: 220784 ( 0.2 MB) Bytes free in central cache |
|---|
| 436 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 437 | MALLOC: 1377152 ( 1.3 MB) Bytes free in thread caches |
|---|
| 438 | MALLOC: 6800 Spans in use |
|---|
| 439 | MALLOC: 3 Thread heaps in use |
|---|
| 440 | MALLOC: 917504 ( 0.9 MB) Metadata allocated |
|---|
| 441 | ------------------------------------------------ |
|---|
| 442 | |
|---|
| 443 | From profiler: |
|---|
| 444 | |
|---|
| 445 | 22.3mb to get to tutorial |
|---|
| 446 | 1.2mb string assign (5.3%) - global initializers?? |
|---|
| 447 | 4.0mb (18%) SDL_CreateRGBSurface |
|---|
| 448 | 2.6mb (11.9%) String |
|---|
| 449 | config add_child 1.5mb (6.5%) |
|---|
| 450 | gnu_cxx_new_allocator allocate 11mb (49.4%) |
|---|
| 451 | |
|---|
| 452 | load tutorial, then load HTTT = memory leak?? |
|---|
| 453 | 9.8mb |
|---|
| 454 | -> we need to free all the image caches... |
|---|
| 455 | |
|---|
| 456 | std::vector |
|---|
| 457 | - overhead of 12 bytes |
|---|
| 458 | - calling reserve tries to allocate exactly the requested size (no strict per-element overhead, if capacity met) |
|---|
| 459 | - adding 1 more than capacity doubles the size |
|---|
| 460 | - calling vector::clear() does not actually free any memory! |
|---|
| 461 | |
|---|
| 462 | std::map |
|---|
| 463 | - overhead of 24 bytes |
|---|
| 464 | - each element overhead of 16-18 bytes |
|---|
| 465 | - calling clear frees all memory |
|---|
| 466 | |
|---|
| 467 | using new memory pool and better maps in config: |
|---|
| 468 | Finished loading level: |
|---|
| 469 | ------------------------------------------------ |
|---|
| 470 | MALLOC: 31318016 ( 29.9 MB) Heap size |
|---|
| 471 | MALLOC: 26023408 ( 24.8 MB) Bytes in use by application |
|---|
| 472 | MALLOC: 3702784 ( 3.5 MB) Bytes free in page heap |
|---|
| 473 | MALLOC: 220080 ( 0.2 MB) Bytes free in central cache |
|---|
| 474 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 475 | MALLOC: 1371744 ( 1.3 MB) Bytes free in thread caches |
|---|
| 476 | MALLOC: 5602 Spans in use |
|---|
| 477 | MALLOC: 3 Thread heaps in use |
|---|
| 478 | MALLOC: 917504 ( 0.9 MB) Metadata allocated |
|---|
| 479 | ------------------------------------------------ |
|---|
| 480 | (saved 5mb in heap size!) |
|---|
| 481 | |
|---|
| 482 | added string pools and better maps to terrain builder and image locator stuff: |
|---|
| 483 | Finished loading level: |
|---|
| 484 | ------------------------------------------------ |
|---|
| 485 | MALLOC: 27123712 ( 25.9 MB) Heap size |
|---|
| 486 | MALLOC: 21908648 ( 20.9 MB) Bytes in use by application |
|---|
| 487 | MALLOC: 3682304 ( 3.5 MB) Bytes free in page heap |
|---|
| 488 | MALLOC: 133120 ( 0.1 MB) Bytes free in central cache |
|---|
| 489 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 490 | MALLOC: 1399640 ( 1.3 MB) Bytes free in thread caches |
|---|
| 491 | MALLOC: 4587 Spans in use |
|---|
| 492 | MALLOC: 2 Thread heaps in use |
|---|
| 493 | MALLOC: 786432 ( 0.8 MB) Metadata allocated |
|---|
| 494 | ------------------------------------------------ |
|---|
| 495 | (saved another 4mb in heap size!!) |
|---|
| 496 | |
|---|
| 497 | 4mb of rgb surfaces... time to start implementing native textures for the gui!! timage |
|---|
| 498 | |
|---|
| 499 | Finished loading level: |
|---|
| 500 | ------------------------------------------------ |
|---|
| 501 | MALLOC: 25026560 ( 23.9 MB) Heap size |
|---|
| 502 | MALLOC: 20019192 ( 19.1 MB) Bytes in use by application |
|---|
| 503 | MALLOC: 3485696 ( 3.3 MB) Bytes free in page heap |
|---|
| 504 | MALLOC: 147280 ( 0.1 MB) Bytes free in central cache |
|---|
| 505 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 506 | MALLOC: 1374392 ( 1.3 MB) Bytes free in thread caches |
|---|
| 507 | MALLOC: 4569 Spans in use |
|---|
| 508 | MALLOC: 2 Thread heaps in use |
|---|
| 509 | MALLOC: 786432 ( 0.8 MB) Metadata allocated |
|---|
| 510 | ------------------------------------------------ |
|---|
| 511 | |
|---|
| 512 | - image locator is still caching some stuff... try doing a texture locator... |
|---|
| 513 | |
|---|
| 514 | changed to avoid caching timage surfaces |
|---|
| 515 | |
|---|
| 516 | Finished loading level: |
|---|
| 517 | ------------------------------------------------ |
|---|
| 518 | MALLOC: 23977984 ( 22.9 MB) Heap size |
|---|
| 519 | MALLOC: 18930280 ( 18.1 MB) Bytes in use by application |
|---|
| 520 | MALLOC: 3473408 ( 3.3 MB) Bytes free in page heap |
|---|
| 521 | MALLOC: 166576 ( 0.2 MB) Bytes free in central cache |
|---|
| 522 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 523 | MALLOC: 1407720 ( 1.3 MB) Bytes free in thread caches |
|---|
| 524 | MALLOC: 4433 Spans in use |
|---|
| 525 | MALLOC: 6 Thread heaps in use |
|---|
| 526 | MALLOC: 786432 ( 0.8 MB) Metadata allocated |
|---|
| 527 | ------------------------------------------------ |
|---|
| 528 | |
|---|
| 529 | - try a global String -> shared_string replacement?? |
|---|
| 530 | - free caches on exiting from level |
|---|
| 531 | |
|---|
| 532 | - now a lot of time is spent on get_terrain() calls, so cache this per tile, and clear cache when terrain changes |
|---|
| 533 | |
|---|
| 534 | struct terrain_constraint in builder.hpp has std::vector<shared_string> set_flag, no_flag, has_flag... BUT these are normally empty, wasting 12 bytes of overhead each. Change to std::vector<>*, which can be NULL |
|---|
| 535 | |
|---|
| 536 | |
|---|
| 537 | #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) |
|---|
| 538 | #define new DEBUG_NEW |
|---|
| 539 | |
|---|
| 540 | ----- |
|---|
| 541 | |
|---|
| 542 | Crash when loading: |
|---|
| 543 | |
|---|
| 544 | check release build settings?? |
|---|
| 545 | - did not properly update device executable when tcmalloc was disabled... had to clean project and delete from device! |
|---|
| 546 | |
|---|
| 547 | 2.2 - |
|---|
| 548 | 2.2.1 - error compiling game_preferences_display.cpp - (standard input):28757:bad immediate value for offset (4112) |
|---|
| 549 | with -Os, works with -O2 |
|---|
| 550 | 3.0 - openGL does not render at all? even on device |
|---|
| 551 | |
|---|
| 552 | on device: |
|---|
| 553 | during loading of tutorial... |
|---|
| 554 | EXC_BAD_INSTRUCTION |
|---|
| 555 | #0 0x32d327e2 in std::operator+<char, std::char_traits<char>, std::allocator<char> > () |
|---|
| 556 | #1 0x00000024 in ?? () |
|---|
| 557 | #2 0x00000024 in ?? () |
|---|
| 558 | #3 0x00000024 in ?? () |
|---|
| 559 | |
|---|
| 560 | ... it worked using debug mode... and compiling with -Os certainly worked before... |
|---|
| 561 | |
|---|
| 562 | theories: |
|---|
| 563 | - compiler is generating incorrect code |
|---|
| 564 | - something was wrong when adding shared_strings or skiplist_map |
|---|
| 565 | - something in tcmalloc is overriding default behavior |
|---|
| 566 | - a hidden memory problem is trashing memory somewhere |
|---|
| 567 | |
|---|
| 568 | try removing ALL tcmalloc code from binary |
|---|
| 569 | - no change |
|---|
| 570 | remove shared_string and skiplist_map |
|---|
| 571 | - works again! |
|---|
| 572 | |
|---|
| 573 | and much faster... |
|---|
| 574 | Took 6361ms to read tutorial cache file, vs 22000ms with cached strings...... |
|---|
| 575 | |
|---|
| 576 | re-implement tcmalloc |
|---|
| 577 | - still works fine |
|---|
| 578 | re-implement shared strings |
|---|
| 579 | - fails! |
|---|
| 580 | -> totally redo the shared string implementation |
|---|
| 581 | - works again |
|---|
| 582 | - with full tcmalloc: still works! |
|---|
| 583 | We're back in business... |
|---|
| 584 | - reimplement skiplist_map, still works on device |
|---|
| 585 | - now emulator has random crashes when using tcmalloc?? |
|---|
| 586 | |
|---|
| 587 | Optimize loading... |
|---|
| 588 | ------------------- |
|---|
| 589 | |
|---|
| 590 | 2:09 to get to level loaded black screen |
|---|
| 591 | 25140ms std::_rbtree from shared_strings |
|---|
| 592 | - try skiplist_map instead of map... |
|---|
| 593 | 9540 from pthread_setspecific gStringPool, shared_string::clear() |
|---|
| 594 | -> there is a setting to make static variables thread safe! that is the culprit... |
|---|
| 595 | - so, reimplement without using static variable |
|---|
| 596 | |
|---|
| 597 | 2:24 using skiplist_maps.... global variable is the same as static variable hehe... try turning off the thread-safe setting... |
|---|
| 598 | 22820 from shared_string::clear() |
|---|
| 599 | 15800 from shared_string::shared_string(shared_string const&) |
|---|
| 600 | 9860 from skiplist |
|---|
| 601 | 8860 from pthread_setspecific |
|---|
| 602 | 8200 from memcmp |
|---|
| 603 | |
|---|
| 604 | fixed shared_string to use reference counting that doesn't require a map lookup |
|---|
| 605 | 1:12 to black tutorial screen |
|---|
| 606 | 10130 shared_string::set |
|---|
| 607 | 5480 pthread_setspecific |
|---|
| 608 | 3180 tc_malloc |
|---|
| 609 | 2710 tc_free |
|---|
| 610 | |
|---|
| 611 | |
|---|
| 612 | in-game optimizations |
|---|
| 613 | --------------------- |
|---|
| 614 | |
|---|
| 615 | inverted call tree: |
|---|
| 616 | 19.6% display::get_terrain_images() -- but this needs to animate the map.... |
|---|
| 617 | 35.7% game_display::draw_report() -- check if we really need to call this so much |
|---|
| 618 | -> a lot faster now! |
|---|
| 619 | |
|---|
| 620 | there is still definitely some memory corruption going on... make a custom memory checker along with Malloc testing flags, to check all memory allocations every n calls |
|---|
| 621 | |
|---|
| 622 | implemented reversed drawing for unit images, cutting memory by 1/2 |
|---|
| 623 | - do the same for semi-brightened, brightened |
|---|
| 624 | |
|---|
| 625 | At titlescreen |
|---|
| 626 | ------------------------------------------------ |
|---|
| 627 | MALLOC: 6291456 ( 6.0 MB) Heap size |
|---|
| 628 | MALLOC: 1371440 ( 1.3 MB) Bytes in use by application |
|---|
| 629 | MALLOC: 4481024 ( 4.3 MB) Bytes free in page heap |
|---|
| 630 | MALLOC: 197552 ( 0.2 MB) Bytes free in central cache |
|---|
| 631 | MALLOC: 15360 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 632 | MALLOC: 226080 ( 0.2 MB) Bytes free in thread caches |
|---|
| 633 | MALLOC: 314 Spans in use |
|---|
| 634 | MALLOC: 1 Thread heaps in use |
|---|
| 635 | MALLOC: 524288 ( 0.5 MB) Metadata allocated |
|---|
| 636 | ------------------------------------------------ |
|---|
| 637 | |
|---|
| 638 | Finished loading level (tutorial) |
|---|
| 639 | ------------------------------------------------ |
|---|
| 640 | MALLOC: 19783680 ( 18.9 MB) Heap size |
|---|
| 641 | MALLOC: 15260272 ( 14.6 MB) Bytes in use by application |
|---|
| 642 | MALLOC: 3796992 ( 3.6 MB) Bytes free in page heap |
|---|
| 643 | MALLOC: 137616 ( 0.1 MB) Bytes free in central cache |
|---|
| 644 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 645 | MALLOC: 588800 ( 0.6 MB) Bytes free in thread caches |
|---|
| 646 | MALLOC: 3595 Spans in use |
|---|
| 647 | MALLOC: 1 Thread heaps in use |
|---|
| 648 | MALLOC: 524288 ( 0.5 MB) Metadata allocated |
|---|
| 649 | ------------------------------------------------ |
|---|
| 650 | |
|---|
| 651 | find wml that we can discard after the cached data is loaded... |
|---|
| 652 | terrain_graphics? |
|---|
| 653 | units or unit_types -> the unit_type_data keeps a config pointer around... |
|---|
| 654 | check unit_types.hpp and convert more std::string to shared_string |
|---|
| 655 | |
|---|
| 656 | saved 2.4mb! |
|---|
| 657 | Finished loading level (tutorial) |
|---|
| 658 | ------------------------------------------------ |
|---|
| 659 | MALLOC: 16637952 ( 15.9 MB) Heap size |
|---|
| 660 | MALLOC: 12817120 ( 12.2 MB) Bytes in use by application |
|---|
| 661 | MALLOC: 3100672 ( 3.0 MB) Bytes free in page heap |
|---|
| 662 | MALLOC: 131344 ( 0.1 MB) Bytes free in central cache |
|---|
| 663 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 664 | MALLOC: 588816 ( 0.6 MB) Bytes free in thread caches |
|---|
| 665 | MALLOC: 3008 Spans in use |
|---|
| 666 | MALLOC: 1 Thread heaps in use |
|---|
| 667 | MALLOC: 524288 ( 0.5 MB) Metadata allocated |
|---|
| 668 | ------------------------------------------------ |
|---|
| 669 | |
|---|
| 670 | Finished loading level (HTTT normal) |
|---|
| 671 | ------------------------------------------------ |
|---|
| 672 | MALLOC: 19783680 ( 18.9 MB) Heap size |
|---|
| 673 | MALLOC: 16546648 ( 15.8 MB) Bytes in use by application |
|---|
| 674 | MALLOC: 2551808 ( 2.4 MB) Bytes free in page heap |
|---|
| 675 | MALLOC: 191712 ( 0.2 MB) Bytes free in central cache |
|---|
| 676 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 677 | MALLOC: 493512 ( 0.5 MB) Bytes free in thread caches |
|---|
| 678 | MALLOC: 3662 Spans in use |
|---|
| 679 | MALLOC: 1 Thread heaps in use |
|---|
| 680 | MALLOC: 524288 ( 0.5 MB) Metadata allocated |
|---|
| 681 | ------------------------------------------------ |
|---|
| 682 | perhaps the +4mb is for the intro image... |
|---|
| 683 | |
|---|
| 684 | Using Memory Monitor: 18.84mb titlescreen, not much help determining where all the memory is going... |
|---|
| 685 | |
|---|
| 686 | implement MAP_MISC for attack-indicator-*, MAP_FOOTSTEPS for footsteps, |
|---|
| 687 | get rid of transparent UI items (but UI in a map is actually bigger...) |
|---|
| 688 | use pvrtc for fullscreen story images, loading screens |
|---|
| 689 | |
|---|
| 690 | openGL resource bytes |
|---|
| 691 | --------------------- |
|---|
| 692 | titlescreen - 7.7mb textures |
|---|
| 693 | HTTT after intro - 21.8mb textures, 11-14 fps |
|---|
| 694 | recruit - goes up to 27.3mb texture use, then crashes? why 5mb textures to recruit something?? |
|---|
| 695 | -> ahhhhh... there was a bug in the new delayed texture delete system in RenderQueue, where it didn't actually delete textures :P |
|---|
| 696 | |
|---|
| 697 | HTTT after intro - 18.9mb |
|---|
| 698 | recruit - now stable at about 19.5mb |
|---|
| 699 | crashed during AI turn, but only 20mb textures used... EXC_BAD_ACCESS in shared_string::clear with null data_ |
|---|
| 700 | memory continues to rise during gameplay... 18.9mb to 24mb in first turn. What is taking almost 5mb of memory?? |
|---|
| 701 | |
|---|
| 702 | |
|---|
| 703 | TODO: use pvrtc for unit maps, but 2x upscale and pre palette swapped: still 50% reduction in size |
|---|
| 704 | |
|---|
| 705 | Memory still slowly rises above 26mb heap, because of units? or AI caching or something? |
|---|
| 706 | Is there a set delay after an AI unit moves? |
|---|
| 707 | |
|---|
| 708 | using unordered maps for std::map<string, x> should speed things up considerably |
|---|
| 709 | something not quite right with the unitmap freeing, like it does not free the least used. It will free one, and then immediately create it again... |
|---|
| 710 | still goes to 28mb on turn 3 HTTT, but seems stable... |
|---|
| 711 | |
|---|
| 712 | optimization during AI turns: |
|---|
| 713 | ----------------------------- |
|---|
| 714 | 17.1% shared_string::set |
|---|
| 715 | 10.7% pthread_setspecific |
|---|
| 716 | 3.6% tc_malloc |
|---|
| 717 | 3.5% gStringPool |
|---|
| 718 | 2.7% std::rb_tree<map_location, std::pair<map_location const, unsigned long> |
|---|
| 719 | |
|---|
| 720 | hmmm.... what if we just never freed shared strings? just let the count remain at zero... it would reduce the cost for shared_string::set and eliminate shared_string::clear |
|---|
| 721 | |
|---|
| 722 | 17.6% shared_string::set |
|---|
| 723 | 8.1% pthread_setspecific |
|---|
| 724 | 4.2% tc_malloc |
|---|
| 725 | 3.7% tc_free |
|---|
| 726 | 2.6% gStringPool |
|---|
| 727 | |
|---|
| 728 | unit::get_state |
|---|
| 729 | unit::movement_cost |
|---|
| 730 | |
|---|
| 731 | optimized checking for "slowed" state |
|---|
| 732 | switched to boost::unordered_map for shared_string -> memory hog and waaaaay too slow to start campaign |
|---|
| 733 | |
|---|
| 734 | (inverted call tree) |
|---|
| 735 | 12.8% std::-Rb_tree<> -> but most from shared_string::set... |
|---|
| 736 | 5.5% tc_free |
|---|
| 737 | 4.7% shared_string::set |
|---|
| 738 | 4.7% tc_malloc |
|---|
| 739 | 2.7% renderQueueRender |
|---|
| 740 | ----- |
|---|
| 741 | |
|---|
| 742 | about 50% is spent rendering, to speed up more, we have to switch back to tile invalidation system, and invalidate all on scroll |
|---|
| 743 | |
|---|
| 744 | |
|---|
| 745 | Memory reduction test: |
|---|
| 746 | |
|---|
| 747 | HttT Easy: |
|---|
| 748 | |
|---|
| 749 | Finished loading level |
|---|
| 750 | ------------------------------------------------ |
|---|
| 751 | MALLOC: 20832256 ( 19.9 MB) Heap size |
|---|
| 752 | MALLOC: 17084936 ( 16.3 MB) Bytes in use by application |
|---|
| 753 | MALLOC: 2994176 ( 2.9 MB) Bytes free in page heap |
|---|
| 754 | MALLOC: 267776 ( 0.3 MB) Bytes free in central cache |
|---|
| 755 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 756 | MALLOC: 485368 ( 0.5 MB) Bytes free in thread caches |
|---|
| 757 | MALLOC: 3815 Spans in use |
|---|
| 758 | MALLOC: 1 Thread heaps in use |
|---|
| 759 | MALLOC: 524288 ( 0.5 MB) Metadata allocated |
|---|
| 760 | ------------------------------------------------ |
|---|
| 761 | |
|---|
| 762 | (had a crash during AI turn, in tcmalloc code??) |
|---|
| 763 | |
|---|
| 764 | Start of Turn 2: 25 mb |
|---|
| 765 | 3: 27 mb |
|---|
| 766 | 4: 27 mb |
|---|
| 767 | 5: 28 mb |
|---|
| 768 | --- |
|---|
| 769 | |
|---|
| 770 | Removed replay code, freed strings |
|---|
| 771 | |
|---|
| 772 | Turn 2: 25 mb |
|---|
| 773 | 3: 26 mb |
|---|
| 774 | 4: 27 mb |
|---|
| 775 | 5: 28 mb |
|---|
| 776 | |
|---|
| 777 | Halo maps, better elves map |
|---|
| 778 | Turn 2: 24mb |
|---|
| 779 | 3: 26mb |
|---|
| 780 | 4: 26mb |
|---|
| 781 | 5: 26mb (-2mb!) |
|---|
| 782 | |
|---|
| 783 | |
|---|
| 784 | ------- |
|---|
| 785 | MUSIC: |
|---|
| 786 | mp3 = 82.4mb |
|---|
| 787 | caf = 248.7mb (+166mb) |
|---|
| 788 | If the fps improvement is significant, we can cut some music... like 1/2.... |
|---|
| 789 | |
|---|
| 790 | terrain builder cache is 3mb, compressed down to 87k!!! |
|---|
| 791 | Title screen, load game, back to title screen.... 9.3mb in use... but of course, we have loaded the full wml, which must be 8mb big! |
|---|
| 792 | |
|---|
| 793 | Finished loading level |
|---|
| 794 | ------------------------------------------------ |
|---|
| 795 | MALLOC: 19562496 ( 18.7 MB) Heap size |
|---|
| 796 | MALLOC: 15904632 ( 15.2 MB) Bytes in use by application |
|---|
| 797 | MALLOC: 2965504 ( 2.8 MB) Bytes free in page heap |
|---|
| 798 | MALLOC: 156672 ( 0.1 MB) Bytes free in central cache |
|---|
| 799 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 800 | MALLOC: 535688 ( 0.5 MB) Bytes free in thread caches |
|---|
| 801 | MALLOC: 3521 Spans in use |
|---|
| 802 | MALLOC: 1 Thread heaps in use |
|---|
| 803 | MALLOC: 524288 ( 0.5 MB) Metadata allocated |
|---|
| 804 | ------------------------------------------------ |
|---|
| 805 | |
|---|
| 806 | - saved 1mb by optimizing builder cache data structures |
|---|
| 807 | Turn 2: 23mb |
|---|
| 808 | 3: 25mb |
|---|
| 809 | 4: 26mb |
|---|
| 810 | |
|---|
| 811 | ------------ |
|---|
| 812 | There needs to be a way for tcmalloc to scavange at will: |
|---|
| 813 | For example, after completing a level, |
|---|
| 814 | |
|---|
| 815 | After cache free |
|---|
| 816 | ------------------------------------------------ |
|---|
| 817 | MALLOC: 26902528 ( 25.7 MB) Heap size |
|---|
| 818 | MALLOC: 14694128 ( 14.0 MB) Bytes in use by application |
|---|
| 819 | MALLOC: 8912896 ( 8.5 MB) Bytes free in page heap |
|---|
| 820 | MALLOC: 2311928 ( 2.2 MB) Bytes free in central cache |
|---|
| 821 | MALLOC: 76800 ( 0.1 MB) Bytes free in transfer cache |
|---|
| 822 | MALLOC: 906776 ( 0.9 MB) Bytes free in thread caches |
|---|
| 823 | MALLOC: 4141 Spans in use |
|---|
| 824 | MALLOC: 1 Thread heaps in use |
|---|
| 825 | MALLOC: 524288 ( 0.5 MB) Metadata allocated |
|---|
| 826 | ------------------------------------------------ |
|---|
| 827 | iPhone system memory used: 54927360 free: 7450624 total: 62377984 |
|---|
| 828 | initialized teams... 712 |
|---|
| 829 | loading units...3556 |
|---|
| 830 | initializing display... 3568 |
|---|
| 831 | TCMALLOC: alloc size 2785280 (Bytes); Total : 28 (Mb) |
|---|
| 832 | iPhone system memory used: 55660544 free: 7012352 total: 62672896 |
|---|
| 833 | TCMALLOC: alloc size 131072 (Bytes); Total : 28 (Mb) |
|---|
| 834 | iPhone system memory used: 55660544 free: 7012352 total: 62672896 |
|---|
| 835 | |
|---|
| 836 | Took 5964 ms to read cached file /var/mobile/Applications/19B7E670-09FB-43B4-877F-CB6B7392B0B9/wesnoth.app/precache/terrain |
|---|
| 837 | done initializing display... 12550 |
|---|
| 838 | initializing managers... 12550 |
|---|
| 839 | done initializing managers... 12559 |
|---|
| 840 | |
|---|
| 841 | |
|---|
| 842 | Finished loading level |
|---|
| 843 | ------------------------------------------------ |
|---|
| 844 | MALLOC: 29687808 ( 28.3 MB) Heap size |
|---|
| 845 | MALLOC: 20835832 ( 19.9 MB) Bytes in use by application |
|---|
| 846 | MALLOC: 8151040 ( 7.8 MB) Bytes free in page heap |
|---|
| 847 | MALLOC: 196976 ( 0.2 MB) Bytes free in central cache |
|---|
| 848 | MALLOC: 0 ( 0.0 MB) Bytes free in transfer cache |
|---|
| 849 | MALLOC: 503960 ( 0.5 MB) Bytes free in thread caches |
|---|
| 850 | MALLOC: 4456 Spans in use |
|---|
| 851 | MALLOC: 1 Thread heaps in use |
|---|
| 852 | MALLOC: 655360 ( 0.6 MB) Metadata allocated |
|---|
| 853 | ------------------------------------------------ |
|---|
| 854 | |
|---|
| 855 | |
|---|
| 856 | Loading time improvements |
|---|
| 857 | -> load uncached tutorial campain |
|---|
| 858 | |
|---|
| 859 | BASE |
|---|
| 860 | Took 18943 ms to SAVE cached file |
|---|
| 861 | |
|---|
| 862 | Improved shared_string::set |
|---|
| 863 | Took 13783 ms to SAVE cached file |
|---|
| 864 | 28% faster than base! |
|---|
| 865 | |
|---|
| 866 | Improved tokenizer::is_alnum to use lookup table |
|---|
| 867 | Took 12282 ms to SAVE cached file |
|---|
| 868 | |
|---|
| 869 | Improved config_cache::cacheSaveString |
|---|
| 870 | Took 562 ms to SAVE cached file |
|---|
| 871 | |
|---|
| 872 | Ok.... that's not a good indicator :P |
|---|
| 873 | |
|---|
| 874 | |
|---|