Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracy #2127

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Tracy #2127

wants to merge 25 commits into from

Conversation

amylizzle
Copy link
Contributor

@amylizzle amylizzle commented Dec 7, 2024

with thanks to https://github.com/wixoaGit/OpenDreamFork/tree/tracy for doing most of the work

When in TOOLS build activates proc logging for DM with source locations.

image
image
also it does native procs so we can use it to make OD faster
image
Memory tracing:
image
image

Note: DreamObject memory footprint is not accurate. It assumes that each object allocates its total possible memory.

@boring-cyborg boring-cyborg bot added the Runtime Involves the OpenDream server/runtime label Dec 7, 2024
@github-actions github-actions bot added the size/L label Dec 7, 2024
OpenDreamRuntime/DreamManager.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamManager.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
@boring-cyborg boring-cyborg bot added the Client Involves the OpenDream client label Dec 8, 2024
OpenDreamRuntime/EntryPoint.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamShared/OpenDreamCVars.cs Fixed Show fixed Hide fixed
[CVarDefs]
public abstract class OpenDreamCVars {
public static readonly CVarDef<string> JsonPath =
CVarDef.Create("opendream.json_path", String.Empty, CVar.SERVERONLY);

Check notice

Code scanning / InspectCode

Replace built-in type reference with a CLR type name or a keyword in static member access expressions Note

Built-in type reference is inconsistent with code style settings
public static readonly CVarDef<int> DebugAdapterLaunched =
CVarDef.Create("opendream.debug_adapter_launched", 0, CVar.SERVERONLY);

public static readonly CVarDef<bool> SpoofIEUserAgent =

Check warning

Code scanning / InspectCode

Inconsistent Naming Warning

Name 'SpoofIEUserAgent' does not match rule 'Static readonly fields (not private)'. Suggested name is 'SpoofIeUserAgent'.
OpenDreamShared/OpenDreamCVars.cs Fixed Show fixed Hide fixed
@amylizzle amylizzle marked this pull request as ready for review December 8, 2024 16:58
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Procs/DMProc.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Procs/DMProc.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamThread.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Procs/DMProc.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Procs/DMProc.cs Fixed Show fixed Hide fixed
@github-actions github-actions bot added size/XL and removed size/L labels Dec 9, 2024
OpenDreamRuntime/Objects/DreamObject.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Resources/DreamResource.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/DreamValue.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Objects/DreamObject.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed

public DreamResource(int id, string? filePath, string? resourcePath) {
Id = id;
ResourcePath = resourcePath;
_filePath = filePath;
_tracyMemoryId = Profiler.BeginMemoryZone((ulong)(Unsafe.SizeOf<DreamResource>() + (ResourceData is null? 0 : ResourceData.Length)), "resource");

Check notice

Code scanning / InspectCode

Merge conditional ?: expression into conditional access Note

Merge conditional expression
OpenDreamRuntime/Resources/DreamResource.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
OpenDreamRuntime/Profile.cs Fixed Show fixed Hide fixed
#endif
}

public static ProfilerMemory? BeginMemoryZone(ulong size, string? name)

Check warning

Code scanning / InspectCode

Return type of a function can be made non-nullable Warning

Return type of 'BeginMemoryZone' can be made non-nullable
@@ -17,6 +17,9 @@
namespace OpenDreamRuntime.Objects {
[Virtual]
public class DreamObject {
#if TOOLS
protected ProfilerMemory? _tracyMemoryId;

Check warning

Code scanning / InspectCode

Inconsistent Naming Warning

Name '_tracyMemoryId' does not match rule 'Instance fields (not private)'. Suggested name is 'TracyMemoryId'.
@@ -19,16 +20,25 @@

private readonly string? _filePath;
private byte[]? _resourceData;
#if TOOLS
private ProfilerMemory? _tracyMemoryId;

Check warning

Code scanning / InspectCode

Non-accessed field: Private accessibility Warning

Field '_tracyMemoryId' is assigned but its value is never used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client Involves the OpenDream client Runtime Involves the OpenDream server/runtime size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant