Skip to content

TreeGen Optimization - #137

Merged
tehtelev merged 1 commit into
StratumServer:indevfrom
tehtelev:indev
Jul 11, 2026
Merged

TreeGen Optimization#137
tehtelev merged 1 commit into
StratumServer:indevfrom
tehtelev:indev

Conversation

@tehtelev

@tehtelev tehtelev commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Added manual position pool and variable for vine positions when generating trees.
An overload has also been added to EvolvingNatFloat, which allows you to compare these objects without converting to object.
This significantly reduces GC pressure, since the code also works recursively.

Type

  • Bug fix
  • Performance
  • New feature
  • Refactor or cleanup
  • Docs or build

Checklist

  • .\scripts\extract-patches.ps1 ran clean.
  • dotnet build VintageStory.slnx -c Release is green.
  • Every vanilla edit has a // Stratum marker.
  • No vanilla source committed.
  • Tested on a real server start, not just compilation.

Performance numbers

Tested on the generation of 10200 chunk columns:

  • TreeGen.growBranch method execution time: reduced from 3549 ms to 2607 ms;
  • TreeGen.growBranch GC memory allocations: reduced from 1.14 Gb MB to 211 MB.

Before
growbranch before trace
growbranch before mem
2026-07-11_12-14-08
2026-07-11_12-14-41

After
growbranch after trace
growbranch after mem
stratum дерево 1
stratum дерево 2

@tehtelev
tehtelev marked this pull request as ready for review July 11, 2026 09:21
@tehtelev
tehtelev merged commit 3e160d1 into StratumServer:indev Jul 11, 2026
4 of 6 checks passed
@tehtelev

Copy link
Copy Markdown
Contributor Author

Sent this and this to the game developers

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.

1 participant