{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/uwa-answer-game-performance-stutter-diagnosis/",
  "atlas": "https://www.pystone.net/?node=uwa-answer-game-performance-stutter-diagnosis#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/uwa-answer-game-performance-stutter-diagnosis.md",
  "context": "https://www.pystone.net/notes/uwa-answer-game-performance-stutter-diagnosis.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:uwa-answer-game-performance-stutter-diagnosis",
  "slug": "uwa-answer-game-performance-stutter-diagnosis",
  "title": "游戏性能卡顿",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "石心.Yong"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "游戏性能卡顿",
  "contentRole": "source",
  "sourceType": "source",
  "sourceMetadata": {
    "author": "石心.Yong"
  },
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "external_source",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "1d6dfa0dfa30663231febebf96d1e11367c736c5d148fd9b0367522ae8da69d5",
  "assets": [
    {
      "reference": "assets/60963d386bb31032f979156e/01.png",
      "url": "/media/8bfc248a8eed14835ff9.png",
      "mediaType": "image/png",
      "contentHash": "8bfc248a8eed14835ff9aa368053e263b9ae9cd36965c266ccad44fa989b805c",
      "byteLength": 181683,
      "width": 1281,
      "height": 852
    },
    {
      "reference": "assets/60963d386bb31032f979156e/02.png",
      "url": "/media/e9a45d01dc4537230382.png",
      "mediaType": "image/png",
      "contentHash": "e9a45d01dc4537230382b76f162b04924d41ef5974ccf85959c90616276021c0",
      "byteLength": 67934,
      "width": 685,
      "height": 801
    },
    {
      "reference": "assets/60963d386bb31032f979156e/03.png",
      "url": "/media/2a1e636d94d0888dee4f.png",
      "mediaType": "image/png",
      "contentHash": "2a1e636d94d0888dee4fab982bbb1e48bf95d2df264fdbc2ed628860b479e1f1",
      "byteLength": 90765,
      "width": 903,
      "height": 503
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "游戏性能卡顿",
      "anchor": "游戏性能卡顿",
      "citation": "https://www.pystone.net/notes/uwa-answer-game-performance-stutter-diagnosis/#%E6%B8%B8%E6%88%8F%E6%80%A7%E8%83%BD%E5%8D%A1%E9%A1%BF"
    },
    {
      "depth": 2,
      "text": "问题",
      "anchor": "问题",
      "citation": "https://www.pystone.net/notes/uwa-answer-game-performance-stutter-diagnosis/#%E9%97%AE%E9%A2%98"
    },
    {
      "depth": 2,
      "text": "我的回答",
      "anchor": "我的回答",
      "citation": "https://www.pystone.net/notes/uwa-answer-game-performance-stutter-diagnosis/#%E6%88%91%E7%9A%84%E5%9B%9E%E7%AD%94"
    },
    {
      "depth": 2,
      "text": "来源与关系",
      "anchor": "来源与关系",
      "citation": "https://www.pystone.net/notes/uwa-answer-game-performance-stutter-diagnosis/#%E6%9D%A5%E6%BA%90%E4%B8%8E%E5%85%B3%E7%B3%BB"
    }
  ],
  "claims": [],
  "outgoing": [
    {
      "id": "note:my-uwa-answers",
      "title": "我的 UWA 问答",
      "url": "https://www.pystone.net/notes/my-uwa-answers/",
      "atlas": "https://www.pystone.net/?node=my-uwa-answers#knowledge-atlas",
      "label": "我的 UWA 问答",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "上位集合：我的 UWA 问答",
      "citation": "https://www.pystone.net/notes/uwa-answer-game-performance-stutter-diagnosis/#%E6%9D%A5%E6%BA%90%E4%B8%8E%E5%85%B3%E7%B3%BB"
    }
  ],
  "incoming": [
    {
      "id": "note:my-uwa-answers",
      "title": "我的 UWA 问答",
      "url": "https://www.pystone.net/notes/my-uwa-answers/",
      "atlas": "https://www.pystone.net/?node=my-uwa-answers#knowledge-atlas",
      "label": "我的 UWA 问答",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "2021-05-13：游戏性能卡顿（渲染模块、Lua）",
      "citation": "https://www.pystone.net/notes/my-uwa-answers/#2021"
    },
    {
      "id": "note:game-graphics-and-runtime",
      "title": "游戏图形与运行时",
      "url": "https://www.pystone.net/notes/game-graphics-and-runtime/",
      "atlas": "https://www.pystone.net/?node=game-graphics-and-runtime#knowledge-atlas",
      "label": "游戏图形与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "我的UWA问答中的“2021-05-13 - 游戏性能卡顿”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#%E6%88%91%E7%9A%84uwa%E9%97%AE%E7%AD%94"
    }
  ],
  "contentMarkdown": "# 游戏性能卡顿\n\n> [!note] 我的 UWA 问答\n> 本文收录我在 UWA 问答发表的公开回答。问题内容归原提问者；回答保留当时语境，技术结论可能受 Unity 版本、平台和项目条件限制。\n\n## 问题\n\n![image.png](assets/60963d386bb31032f979156e/01.png)\n\n加载场景时，查询出现这个耗时有点卡顿。\n\n这个有点看不懂，EditorOnly 是否意味着真机上不会理会这个问题\n\n能详解这个具体是为什么出现么？\n\n- 提问者：Goto\n- 提问时间：2021-05-08 23:26:48\n\n## 我的回答\n\nReadObject实际上是在加载之后，对Object进行反序列化。一个prefab反序列化后，会有大量的Object。IntegrateAllThreadedObjects会遍历这些Object，而Loading.CheckConsistency就是在遍历这些Object时，对数据进行一致性检验。\n\n所谓一致性检验，就是比如，对下图prefab的序列化文件，会检查两个红框中的fileID是否一致。\n\n![image.png](assets/60963d386bb31032f979156e/02.png)\n\n图片来源：https://www.cnblogs.com/luguoshuai/p/12323186.html。 如这篇博文所讲，如果两个fileID不一致，会有CheckConsistency的报错。\n\n为什么只在Editor下进行一致性检验，而打包后Runtime不需要检验呢？ 笔者推测是在打包的时候已经对所有对象都检验过了，Runtime就不需要检验，也避免了检验带来的高耗时。\n\n证据如下图，某次打包的报错堆栈里面，包含了CheckConsistency的步骤：\n\n![image.png](assets/60963d386bb31032f979156e/03.png)\n\n图片来源：https://networm.me/2019/06/23/unity-has-stopped-working/\n\n- 回答时间：2021-05-13 09:27:36\n- 最后更新：2021-05-13 09:28:45\n- 采纳状态：未采纳\n\n## 来源与关系\n\n- 上位集合：[[10-计算机、信息技术与工程/05-游戏图形与运行时/我的UWA问答/我的UWA问答|我的 UWA 问答]]\n- UWA 标签：渲染模块、Lua\n- 原始问题：[游戏性能卡顿](https://answer.uwa4d.com/question/60963d386bb31032f979156e)\n- 源页最后更新：2021-05-21 18:37:20\n"
}
