Show More
Commit Description:
Optimize PreserveCounts and only recalculate when needed....
Commit Description:
Optimize PreserveCounts and only recalculate when needed.
Previously would recalculate preservecounts every Update call (~1 per frame), which isn't necessary
when there's no tick. Might be some room to tweak, like doing these updates only when preserves change.
Some measurements: This takes about 30ms versus the .25 ms with no preserve (then like .0002ms).
When the map is filled up with preserve, about 35ms and 9ms. With a handful of
cells, it's more like 0.8ms (before JIT optimizes most of it away).
References:
File last commit:
Show/Diff file:
Action:
ImGui.NET/Generated/ImDrawVert.gen.cs
26 lines | 1.0 KiB | text/x-csharp | CSharpLexer
26 lines | 1.0 KiB | text/x-csharp | CSharpLexer
r16 | using System; | |||
using System.Numerics; | ||||
using System.Runtime.CompilerServices; | ||||
using System.Text; | ||||
namespace ImGuiNET | ||||
{ | ||||
public unsafe partial struct ImDrawVert | ||||
{ | ||||
public Vector2 pos; | ||||
public Vector2 uv; | ||||
public uint col; | ||||
} | ||||
public unsafe partial struct ImDrawVertPtr | ||||
{ | ||||
public ImDrawVert* NativePtr { get; } | ||||
public ImDrawVertPtr(ImDrawVert* nativePtr) => NativePtr = nativePtr; | ||||
public ImDrawVertPtr(IntPtr nativePtr) => NativePtr = (ImDrawVert*)nativePtr; | ||||
public static implicit operator ImDrawVertPtr(ImDrawVert* nativePtr) => new ImDrawVertPtr(nativePtr); | ||||
public static implicit operator ImDrawVert* (ImDrawVertPtr wrappedPtr) => wrappedPtr.NativePtr; | ||||
public static implicit operator ImDrawVertPtr(IntPtr nativePtr) => new ImDrawVertPtr(nativePtr); | ||||
public ref Vector2 pos => ref Unsafe.AsRef<Vector2>(&NativePtr->pos); | ||||
public ref Vector2 uv => ref Unsafe.AsRef<Vector2>(&NativePtr->uv); | ||||
public ref uint col => ref Unsafe.AsRef<uint>(&NativePtr->col); | ||||
} | ||||
} | ||||