Update 25.11.12

A small update focused on optimizations and fixes

It's a hackweek this week at Facepunch - so everyone is scratching their itches and expanding themselves by working on other things. That means this week's patch is a bit lighter than the previous ones.

.NET 10 released this week, we'll be updating staging to use it later today, please give it a go, developers you'll need Visual Studio 2026 or your favourite code editor with .NET SDK 10.
ByteStream is the foundation of our network system, and a few other systems. It's used to basically read and write raw data to byte memory, to send and receive over the network.

I noticed that in a few places we had started using a pooled MemoryStream because ByteStream was apparently too slow. This hurt my feelings because I made ByteStream to be a faster, zero allocation alternative to MemoryStream and BinaryWriter/Reader.

So I spent some time speeding it up. It's now on average 5x to 50x faster than it was.
I added this graph to the public metrics showing what we're allocating most.
You can copy, paste and reset on inline editors now as expected
The CommandList was added a while back, and is used to build up render commands that execute on the render thread. We don't want people running code on the render threads - because it causes all kinds of hurt.

I'd coded this in a lazy way because it was a proof of concept. So it wasn't that optimal. It was allocating a lot.

We are using it more now, and plan to use it a lot more in the future - so I changed how it works internally to be pretty much allocation free.
There was a lot of weirdness happening with the Time variables, causing what felt like stuttering & irresponsiveness.
I fixed time being 1 frame too old in Update() as well as cleaning up FixedUpdate() lerping.
matt
Facepunch
JoinedApr 2021 Posts275 Score2,640
Update 25.11.12 : news/update-25-11-12
piC0peek
Member
JoinedSep 2021 Posts21 Score3,856
first lmao
Titanovsky
Member
JoinedSep 2021 Posts356 Score5,678
it's the good patch 👍
The MAZZTer
Member
JoinedJul 2024 Posts22 Score0
This ByteStream intrigues me. Perhaps at some point Facepunch could consider releasing some of these types of things (useful general purpose managed .NET classes) in nuget packages for .NET usable outside of s&box?
garry
Facepunch
JoinedApr 2021 Posts454 Score2,405
They are quite specialized, but I'm open to it
G+
Member
JoinedFeb 2024 Posts82 Score6,990
excited to see what hack week projects come up!!
Trundler
Member
JoinedOct 2021 Posts129 Score996
Excited for .NET 10 next week
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.