<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Try to map name, album and group to properties (within the schema
definitions)<br>
Accessing properties is much faster than reading the whole structure
into memory.<br>
See <a class="moz-txt-link-freetext" href="http://www.opencms-wiki.org/XMLContent">http://www.opencms-wiki.org/XMLContent</a> for further details.<br>
<br>
\Fabian<br>
<br>
On 03.11.2010 10:22, Juan Antonio Ruiz wrote:
<blockquote cite="mid:001301cb7b38$b18e7740$14ab65c0$@es"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML con formato previo Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Texto de globo Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.TextodegloboCar
{mso-style-name:"Texto de globo Car";
mso-style-priority:99;
mso-style-link:"Texto de globo";
font-family:"Tahoma","sans-serif";}
span.EstiloCorreo19
{mso-style-type:personal-compose;
color:black;}
span.HTMLconformatoprevioCar
{mso-style-name:"HTML con formato previo Car";
mso-style-priority:99;
mso-style-link:"HTML con formato previo";
font-family:"Courier New";}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal"><span style="color: black;">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: black;"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: black;" lang="EN-US">I
have a big problem. My
resources list is very large (around 1000). When I get a
value with
getStringValue, it is very much slow (around 15 millesec.
per resource ). Total
is 15 seconds. It is my code:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: black;" lang="EN-US"><o:p> </o:p></span></p>
<pre style="line-height: 15pt;"><span style="color: black;" lang="EN-US">for (int i = 0; i < list.size(); i++) {<o:p></o:p></span></pre>
<p class="MsoNormal"><span style="color: black;" lang="EN-US">…<o:p></o:p></span></p>
<pre style="line-height: 15pt;"><span style="color: black;" lang="EN-US">CmsFile file = cmsObj.readFile(resource);
CmsXmlContent content = CmsXmlContentFactory.unmarshal(cmsObj, file);
String name = content.getStringValue(cmsObj,"Name[1]", locale); <o:p></o:p></span></pre>
<p class="MsoNormal" style="line-height: 15pt;"><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">String album =
content.getStringValue(cmsObj,"Album[1]", locale); <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 15pt;"><span
style="font-size: 10pt; font-family: "Courier
New"; color: black;" lang="EN-US">String group =
content.getStringValue(cmsObj,"Group[1]", locale)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: black;" lang="EN-US">…<o:p></o:p></span></p>
<pre style="line-height: 15pt;"><span style="color: black;">}<o:p></o:p></span></pre>
<p class="MsoNormal"><span style="color: black;" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: black;" lang="EN-US">Is
there another way?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color: black;" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color: black;" lang="EN-US">Thanks.<o:p></o:p></span></p>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext" href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a></pre>
</blockquote>
<br>
</body>
</html>