. Optimize ApplicationScriptUtils.toJSON() - threadlocal cache for namespace resolution to avoid DD access, smarter retrieval of cm:person properties - 40% quicker or more in some cases

. Convert short qnames to long qnames in our templates to avoid DD access to resolve full qnames
. Optimize out N+1 queries from calling RatingService.getRating() unless the document has at least one Like (which is available in the rolled up property already present on the node) - up to 99% quicker when building "Likes" JSON structure...!
. Added new optimized method to FileFolderService to retrieve a cm:name based path - only the String for each path element not the full FileInfo structure for each (avoid full getProperties() - 70% quicker to build webdav URL
overall before/after to retrieve doclist2 script (8x concurrent threads x25 repeats etc.) Before: 1030ms After: 645ms
Also improves original doclist script (used by dashlets) and single node retrievals.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@47448 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2013-03-01 15:43:08 +00:00
parent 380bd69941
commit 3373456c13
9 changed files with 257 additions and 68 deletions

View File

@@ -103,11 +103,11 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.util.FileFilterMode;
import org.alfresco.util.FileFilterMode.Client;
import org.alfresco.util.GUID;
import org.alfresco.util.ISO8601DateFormat;
import org.alfresco.util.ISO9075;
import org.alfresco.util.Pair;
import org.alfresco.util.FileFilterMode.Client;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONException;
@@ -956,9 +956,9 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
this.properties = new ContentAwareScriptableQNameMap<String, Serializable>(this, this.services);
Map<QName, Serializable> props = null;
if (nodeInfo != null)
if (this.nodeInfo != null)
{
props = nodeInfo.getProperties();
props = this.nodeInfo.getProperties();
}
else
{
@@ -1334,7 +1334,7 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
{
if (getIsContainer() || getIsDocument())
{
List<FileInfo> paths = this.services.getFileFolderService().getNamePath(null, getNodeRef());
List<String> paths = this.services.getFileFolderService().getNameOnlyPath(null, getNodeRef());
// build up the webdav url
StringBuilder path = new StringBuilder(128);
@@ -1344,7 +1344,7 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
for (int i=1; i<paths.size(); i++)
{
path.append("/")
.append(URLEncoder.encode(paths.get(i).getName()));
.append(URLEncoder.encode(paths.get(i)));
}
url = path.toString();
}
@@ -2774,7 +2774,7 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
/**
* Creates a thumbnail for the content property of the node.
*
* The thumbnail name correspionds to pre-set thumbnail details stored in the
* The thumbnail name corresponds to pre-set thumbnail details stored in the
* repository.
*
* If the thumbnail is created asynchronously then the result will be null and creation