You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@johnzon.apache.org by "Markus Karg (Jira)" <ji...@apache.org> on 2019/09/21 15:58:00 UTC

[jira] [Created] (JOHNZON-278) Return constant instead of new instance of empty block / empty array

Markus Karg created JOHNZON-278:
-----------------------------------

             Summary: Return constant instead of new instance of empty block / empty array
                 Key: JOHNZON-278
                 URL: https://issues.apache.org/jira/browse/JOHNZON-278
             Project: Johnzon
          Issue Type: Improvement
          Components: Core
    Affects Versions: 1.2.0, 1.2.1
            Reporter: Markus Karg


Even in these days of modern Java, reducing memory consumption, GC stress and memory fragmentation, are beneficial side aspects.

If makes no sense to create new *empty* instances of JsonArray and JsonObject again and again. For this case, JSON-P provides special *constants*.

It makes sense to return these constants always.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)