summaryrefslogtreecommitdiffstats
path: root/server/tests/src
diff options
context:
space:
mode:
authorFabian Lange <lange.fabian@gmail.com>2014-04-03 22:35:51 +0200
committerFabian Lange <lange.fabian@gmail.com>2014-04-09 11:47:21 +0200
commit52db8e5457e1afcb56a5047adbddf15c44754e8c (patch)
tree4af8ba00cb3ca2a1dd751e89a34aec7071bb4ae4 /server/tests/src
parent3edf6bd933804413094aca2cd678a0f58369d7d0 (diff)
downloadvaadin-framework-52db8e5457e1afcb56a5047adbddf15c44754e8c.tar.gz
vaadin-framework-52db8e5457e1afcb56a5047adbddf15c44754e8c.zip
Optimizes memory and CPU usage in JSONCodec (#13545)
The null element and the empty JSONArray are frequently created and used as temporary objects to be encoded by the json encoder. Because they are never manipulated it is possible to reuse the same empty element again and save a significant amount of temp objects. This also helps jsonEquals, which then can return faster due to: if (fieldValue == referenceValue) return true jsonEquals does not need to check the referenceValue for JSONobject.NULL. The invoking code makes sure this never happens. Boolean and Integer values are very often and much more efficiently compared directly instead of using toString. Change-Id: I5fd736427019406469357cda1115d2683b7a5e2b
Diffstat (limited to 'server/tests/src')
-rw-r--r--server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java b/server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java
index 0a36c7f7ce..e938a1cd37 100644
--- a/server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java
+++ b/server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java
@@ -63,6 +63,7 @@ public class TestClassesSerializable extends TestCase {
"com\\.vaadin\\.sass.*", //
"com\\.vaadin\\.testbench.*", //
"com\\.vaadin\\.util\\.CurrentInstance\\$1", //
+ "com\\.vaadin\\.server\\.JsonCodec\\$1", //
"com\\.vaadin\\.server\\.communication\\.PushConnection", //
"com\\.vaadin\\.server\\.communication\\.AtmospherePushConnection", //
"com\\.vaadin\\.util\\.ConnectorHelper", //