Skip to content

Commit b4c9f6e

Browse files
committed
Performance optimizations, fixes, support net7
1 parent 09a9068 commit b4c9f6e

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

UMS.Analysis/SnapshotFile.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public class SnapshotFile : LowLevelSnapshotFile
2525

2626
private readonly Dictionary<int, BasicTypeInfoCache> _typeInfoCacheByTypeIndex = new();
2727

28-
private readonly Dictionary<ulong, RawManagedObjectInfo> _managedObjectInfoCache = new();
29-
30-
private readonly Dictionary<ulong, ManagedClassInstance> _managedClassInstanceCache = new();
28+
private readonly Dictionary<ulong, RawManagedObjectInfo> _managedObjectInfoCache = new(1024*1024 * 4);
29+
30+
private readonly Dictionary<ulong, ManagedClassInstance> _managedClassInstanceCache = new(1024 * 1024 * 4);
3131

3232
private readonly Dictionary<int, string> _typeNamesByTypeIndex = new();
3333

UMS.Analysis/Structures/Objects/ManagedClassInstance.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ private IFieldValue[] ReadFields(SnapshotFile file, Span<byte> data, int depth)
9191
if (CheckIfRecursiveReference())
9292
return Array.Empty<IFieldValue>();
9393

94-
if (depth > 250)
94+
if (depth > 350)
9595
{
96-
Console.WriteLine($"Stopped reading fields due to too-deeply nested object at depth {depth}");
96+
Console.WriteLine($"Stopped reading fields due to too-deeply nested object at depth {depth} (this object is of type {file.GetTypeName(TypeInfo.TypeIndex)}, parent is of type {file.GetTypeName(TypedParent.TypeInfo.TypeIndex)})");
9797
return Array.Empty<IFieldValue>();
9898
}
9999

UMS.Analysis/UMS.Analysis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<LangVersion>preview</LangVersion>

UMS.LowLevel/UMS.LowLevel.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

UnityMemorySnapshotThing/UnityMemorySnapshotThing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<ServerGarbageCollection>true</ServerGarbageCollection>

0 commit comments

Comments
 (0)