Skip to content

Store VPK entries as structs indexing the tree buffer - #198

Merged
marchc1 merged 1 commit into
SourceDotNET:mainfrom
ZehMatt:vpk-optimization
Oct 16, 2026
Merged

marchc1 merged 1 commit into
SourceDotNET:mainfrom
ZehMatt:vpk-optimization

Conversation

@ZehMatt

@ZehMatt ZehMatt commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

While looking into whats using up quite a bit of memory I noticed that each VpkEntry held a couple strings while also keeping all the bytes of the tree so I refactored it to index into the byte array and turning VpkgEntry into a plain struct which improves the overhead quite a bit.

Before:
image

After:
image

@marchc1 marchc1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of this is old stuff from https://github.com/antim0118/SharpVPK (specifically this fork since it had V1 and V2 support) and then my attempts to improve it, so not surprising this was still kinda awful

@marchc1
marchc1 merged commit 6e0392d into SourceDotNET:main Oct 16, 2026
4 checks passed
@ZehMatt
ZehMatt deleted the vpk-optimization branch October 16, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants