我在定期生成的 trie 中有一些统计信息。我想生成关于两次尝试之间差异的火焰图。我怎么做?
t = pygtrie.StringTrie(separator=os.path.sep)
for dirpath, unused_dirnames, filenames in os.walk(ROOT_DIR):
for filename in filenames:
filename = os.path.join(dirpath, filename)
try:
filestat = os.stat(filename)
except OSError:
continue
if stat.S_IFMT(filestat.st_mode) == stat.S_IFREG:
t[filename] = filestat.st_size