johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Karg (Jira)" <j...@apache.org>
Subject [jira] [Created] (JOHNZON-278) Return constant instead of new instance of empty block / empty array
Date Sat, 21 Sep 2019 15:58:00 GMT
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)

Mime
View raw message