Skip to content

Instantly share code, notes, and snippets.

View Vercidium's full-sized avatar

Vercidium Vercidium

View GitHub Profile
/* Changes made:
* Using chunkXCounter and chunkZCounter to check when we have moved into a new chunk,
* rather than (x % Constants.ChunkSize) * Constants.ChunkSize each loop. This removes all %, / and * operators
* Comparisons against 0 in loops where possible
* Using .Reset() on the block, rather than getting a reference and modifying index and health on two different lines
* Previous benchmark: 100 runs in 5315ms.
* New benchmark: 100 runs in 4755ms
* */
byte[] fileData = r.ReadBytes(bytesRemaining);
@Vercidium
Vercidium / precalculatedTrig.cs
Last active February 20, 2020 21:48
Performance benchmark for using Math.Sin(...) and Math.Cos(...) vs accessing values from a precalculated sine wave array.
ModelHelper.InitialiseTrigonometry();
Random rand = new Random();
int count = 524288;
float[] randoms = new float[count];
float[] result = new float[count];
int[] mathTimes = new int[100];
int[] arrayTimes = new int[100];
@Vercidium
Vercidium / sectorsedge-windbg-log.txt
Created January 23, 2022 01:56
WinDbg log from a Sector's Edge crash dump (.NET 6)
Microsoft (R) Windows Debugger Version 10.0.22473.1005 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File [C:\Users\verc\Downloads\sectorsedge.exe.13044.dmp]
User Mini Dump File: Only registers, stack and portions of memory are available
************* Path validation summary **************