aboutsummaryrefslogtreecommitdiff
path: root/src/profiler.h
Commit message (Expand)AuthorAge
* Better F6 profiler (#8750)SmallJoker2019-08-13
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)Loïc Blot2017-08-19
* Optimize headers (part 2) (#6272)Loïc Blot2017-08-18
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
* Cpp11 patchset 11: continue working on constructor style migration (#6004)Loïc Blot2017-06-18
* Use C++11 mutexes only (remove compat code) (#5922)Loïc Blot2017-06-06
* Time: Change old `u32` timestamps to 64-bit (#5818)SmallJoker2017-05-26
* Some performance optimizations (#5424)Loïc Blot2017-03-22
* Clean up threadingShadowNinja2015-08-23
* Move globals from main.cpp to more sane locationsCraig Robbins2015-04-01
* Optimize Profiler::avg()gregorycu2015-03-07
* Fix f6 debug/profiler displayCraig Robbins2014-12-08
* Fix msvc2012 buildsapier2014-06-29
* Add function to deregister a profiler from profiler listsapier2014-01-06
* Cleanup jthread and fix win32 buildsapier2013-12-01
* Always use builtin JThread librarykwolekr2013-09-15
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Set of changes to build mineTest using Visual Studio 11.0. These affectMukul Sati2013-03-24
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Optimize headersPerttu Ahola2012-06-17
* Properly and efficiently use split utility headersPerttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* Add ScopeProfilerType SPT_GRAPH_ADDPerttu Ahola2012-03-21
* Profiler graphPerttu Ahola2012-03-21
* F1 toggles HUD, F2 toggles chat, F5 toggles debug info, F6 toggles profiler p...Kahrl2012-02-01
* Some more profiler stuff to get the hang on what really uses CPUPerttu Ahola2011-10-16
* Improve debug profiler usage for investigating CPU usage of serverPerttu Ahola2011-10-16
* Reduced the CPU usage of the sent block selector algorithmPerttu Ahola2011-05-31
u += 2**64 return u # Convert sector folder(s) to integer def getSectorPos(dirname): if len(dirname) == 8: # Old layout x = parseSigned16bit(dirname[:4]) z = parseSigned16bit(dirname[4:]) elif len(dirname) == 7: # New layout x = parseSigned12bit(dirname[:3]) z = parseSigned12bit(dirname[4:]) else: print('Terrible sector at ' + dirname) return return x, z # Convert block file to integer position def getBlockPos(sectordir, blockfile): p2d = getSectorPos(sectordir) if not p2d: return if len(blockfile) != 4: print("Invalid block filename: " + blockfile) y = parseSigned16bit(blockfile) return p2d[0], y, p2d[1] # Convert location to integer def getBlockAsInteger(p): return int64(p[2]*16777216 + p[1]*4096 + p[0]) # Init create = False if not os.path.isfile(path + 'map.sqlite'): create = True conn = sqlite3.connect(path + 'map.sqlite') if not conn: exit('Could not open database.') cur = conn.cursor() if create: cur.execute("CREATE TABLE IF NOT EXISTS `blocks` (`pos` INT NOT NULL PRIMARY KEY, `data` BLOB);") conn.commit() print('Created database at ' + path + 'map.sqlite') # Crawl the folders count = 0 t = time.time() for base in paths: v = 0 if base == 'sectors': v = 1 elif base == 'sectors2': v= 2 else: print('Ignoring base ' + base) continue for root, dirs, files in os.walk(path + base): if files: for block in files: pos = getBlockAsInteger(getBlockPos(root[(-8 if v == 1 else -7 if v == 2 else 0):], block)) if pos is None: print('Ignoring broken path ' + root + '/' + block) continue f = open(root+'/'+block, 'rb') blob = f.read() f.close() if sys.version_info.major == 2: blob = buffer(blob) else: blob = memoryview(blob) cur.execute('INSERT OR IGNORE INTO `blocks` VALUES(?, ?)', (pos, blob)) count += 1 if(time.time() - t > 3): t = time.time() print(str(count)+' blocks processed...') conn.commit() print('Finished. (' + str(count) + ' blocks)')