Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Memory savings #1650

Open
Open
@lultimouomo

Description

@lultimouomo

Hi Benoit,

I noticed that ArduinoJson needs a pretty sizeable amount of memory for each object (16 bytes on ESP32); even by using zero-copy I find that I can need more memory for theJsonDocument than for the serialized Json.
I see that a lot of work has been put into saving memory, but I was wondering if you would consider PRs for the following changes:

make support forserialized() optional

By removing support forserialized() via a preprocessor definition we could then removeasRaw fromVariantContent and also remove_tail fromCollectionData and reduce the size ofVariantContent to the size of a pointer/float. Removing_tail would mean that to add a collection element we need to walk the linked list each time, but in certain situations it could be a reasonable tradeoff.

add support for short strings

In case of very short strings we could apply short-string optimization and store up to 3 characters for 32bit archs and 7 characters for 64bit archs (+1 for null termination) in place of the 'char *'. This is probably a marginal improvement, especially because 64bit archs where it can be applied more easily don't probably need it as much. Also it won't matter for zero-copy.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp