2025-07-02
发布了一篇新笔记🔗 [(mac vmware fusion) windows arm安装与使用 - Truxton's blog] https://truxton2blog.com/mac-vmware-fusion-windows-arm/,html总数从391变成了392,但fastcgi文件夹体积却意外地明显减少了:从33.271822 MB直接降到33.241735 MB,很不正常
很诡异,所以回档分析一下原因。把两次preload的fastcgi文件夹分别复制了一份(命名为small和big),然后让gpt给我写了个小程序
import os
import pandas as pd
def get_all_files(base_dir):
file_map = {}
for root, _, files in os.walk(base_dir):
for f in files:
full_path = os.path.join(root, f)
rel_path = os.path.relpath(full_path, base_dir)
file_map[rel_path] = full_path
return file_map
def get_file_size_kb(path):
return os.path.getsize(path) / 1024
def compare_dirs(big_dir, small_dir):
big_files = get_all_files(big_dir)
small_files = get_all_files(small_dir)
data = []
common_keys = big_files.keys() & small_files.keys()
for rel_path in sorted(common_keys):
big_path = big_files[rel_path]
small_path = small_files[rel_path]
big_size = get_file_size_kb(big_path)
small_size = get_file_size_kb(small_path)
diff = big_size - small_size
data.append({
"big_name": big_path,
"small_name": small_path,
"big_size": round(big_size, 2),
"small_size": round(small_size, 2),
"diff": round(diff, 2)
})
df = pd.DataFrame(data)
return df
if __name__ == "__main__":
df = compare_dirs("big", "small")
df = df.sort_values(by='diff')
# print(df)
# Optionally save to CSV:
df.to_csv("size_diff.csv", index=False)
最后发现是RSS Feed链接🔗 [truxton2blog.com/feed/?cat_48] https://truxton2blog.com/feed/?cat_48 在发布新笔记后体积爆减,diff了一下终于明白了:
增加了:windows arm的笔记(虽然publish date设置成了2024年11月,但modified date是今天,所以貌似还是会出现在RSS里面)
去掉了了一个巨无霸:🔗 [(2024年5月)学习pandas(最基础操作) - Truxton's blog] https://truxton2blog.com/2024-05-learn-pandas/
由于去掉的内容实在太多,新增的页面体积比不上减少的,所以最终fastcgi文件夹的体积也减少了。