Repository navigation
Commit dac4a43
The shader split reads each SARC member's name up to its own NUL (#968)
sarc_members took each member's name by splitting the whole rest of the archive at every NUL and keeping the first piece, so the work grew with the archive's size times its member count. Fire Emblem Fortune's Weave's split took 12 minutes, 6 of them in one 9.8 MB SARC (Layout/Common.arc.zst). It now finds the name's own NUL and decodes only that, and only for a member that has a name. The author reports that game's split at 1:51 and the same 23,638 shaders on Donkey Kong Bananza.
Checked: test_split_nesting.py's new test reads an 800-member archive and compares the names and data. The old and new sarc_members gave the same results on crafted archives (nameless members, unterminated names, offsets past the end, bad UTF-8, damaged archives) and on 20,000 random ones; an 800-member synthetic archive takes 1.2 ms against 47 s. No regression games were run: the output of this one function is unchanged.
Co-authored-by: capibawa <[email protected]>1 parent b1dee89 commit dac4a43
2 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2117 | 2117 | | |
2118 | 2118 | | |
2119 | 2119 | | |
2120 | | - | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
2121 | 2124 | | |
2122 | 2125 | | |
2123 | 2126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
77 | 87 | | |
78 | 88 | | |
0 commit comments