Skip to content

Managed std.json.Value #25719

@gh22749268

Description

@gh22749268

Hello, i started to use Zig recently to write my personal project and i think it's great!
However i found defaut behaviour of std.json.Value not fitting to me due to large amount of small nested objects. Currently it's managed HashMap for object (arrays are also managed) because of that my memory usage is about 40% larger due to allocation of allocator.

I made simple copy of std.json.Value into my project, changing HashMap and Array into unmanaged variants, added allocator to method calls and as expected my memory usage was smaller, without any immediate issues.

Is there any reason for managed state being default one?
If so maybe there should be also unmanaged variant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingImplementing this issue could cause existing code to no longer compile or have different behavior.enhancementSolving this issue will likely involve adding new logic or components to the codebase.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions