3

I am using a simple method to create criteria for content delivery api which takes publication id and item type as parameter and return a criteria back. The code is as below

public static Criteria GetCriteriaOnPubIdAndItemType(int publicationId,ItemType itemType )

{
      PublicationCriteria pubCriteria = new PublicationCriteria(publicationId);
      ItemTypeCriteria itemTypeCriteria = new ItemTypeCriteria((int)itemType);
      return CriteriaFactory.And(pubCriteria, itemTypeCriteria);

  }

Using ant performance profiler i am getting 3.778 seconds for 2 hits to this method which means its taking around 1.8 seconds to create criteria. Am i doing something wrong or is it okay to have this time duration

Regards, Rajendra

2

There's something going on with your environment. I get consistently "0 milliseconds" executing the following code (with .NET, which has additional overhead than Java):

Stopwatch watch = new Stopwatch();
watch.Start();
PublicationCriteria pubCriteria = new PublicationCriteria(5);
ItemTypeCriteria itemType = new ItemTypeCriteria(16);
Criteria criteria = CriteriaFactory.And(pubCriteria, itemType);
watch.Stop();
content.InnerText = "Took " + watch.ElapsedMilliseconds + " milliseconds";
  • Thanks Nuno, I will check if there is some issue with the environment as we have implemented it a few days ago only. – rdhaundiyal Mar 22 '13 at 9:07
  • There were two instances of visual studio running on the dev machine and were consuming the memory and cpu usage. The time has come down to 003 ms. Thanks – rdhaundiyal Mar 22 '13 at 12:46
-1

Check Following:

1) Are following up the Maintenance Plan for Content Manager and Broker Database as illustrated in the Installation Document? If not, Tune up your database as suggested by the SDL Tridion. For tune up either you can contact with your DBA or get the query from SDL Support

2) Is the CMS server configuration and DB server configuration from Hardware perspective up to the mark and in line what has been recommended by SDL Tridion?

  • Thanks Pankaj, but does it involve a database hit while creating a criteria as it is not executing the query. – rdhaundiyal Mar 22 '13 at 9:05
  • No, this case doesn't involve the database at all. – Nuno Linhares Mar 22 '13 at 10:35
  • Ohh yes, My bad, I overlooked it :( – Pankaj Gaur Mar 22 '13 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.