Do not instantiate augmentation HashMap in DTO builders 62/21162/2
authorRobert Varga <rovarga@cisco.com>
Tue, 26 May 2015 22:18:57 +0000 (00:18 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 27 May 2015 16:15:55 +0000 (16:15 +0000)
commit2cb012f4e814859e10726d02cb1c073321316ab3
tree66166ee8f66c9cca188a05429f75c86190ad06ce
parentaab5a09be514bc7622416bf2a6d4d6a7465f9d7c
Do not instantiate augmentation HashMap in DTO builders

Tracing has revealed that the OpenFlowPlugin creates a lot of builders,
instantiation a million HashMaps, which accounts for 1% of CPU time.
Most of these maps are never touched, so we can easily optimize this
away by lazily instantiating a HashMap when the first augmentation is
added. Also prevents copying of empty augmentation in the copy
constructor.

Change-Id: I592fe6af65c9f3b65038def8bb4069666bfdc375
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/BuilderTemplate.xtend