RTML Tips# 1—Optimizing Publishing Times

March 27, 2006 | In RTML |

The following post comes from Sheridan Rawlins, Yahoo! Small Business engineer, covers the use of RTML Operators and how certain custom template configurations can lead to long publishing times. The post is intended for Yahoo! Store Developers or merchants with an advanced understanding of RTML. Learn more about RTML.

In my role as lead engineer for the Editor & RTML language, I have come across questions regarding “slow publishing”. Almost invariably, the store or developer requesting assistance has customized their templates in some way. I would like to share some insights by describing answers to some frequently asked questions, along with their resolutions. With this knowledge, developers should be able to spread the best-practices for reducing publishing times for templates.

What causes Editor publishing to take a long time?

The most common root cause of slowness is due to having to fetch objects from disk. We do our best to cache as much as we can in memory, but as complex RTML templates are run on larger stores, or stores with complex object relationships, objects may be written back to disk and flushed from the cache to make room for other objects.

What operators cause objects to be read from disk?

  • WITH-OBJECT
  • FOR-EACH-OBJECT
  • GET-PATH-TO (single “breadcrumb”)
  • GET-ALL-PATHS-TO (multi “breadcrumbs”)

Contrary to popular belief, the WHOLE-CONTENTS operator does not cause cache-misses. However, it is usually used in conjunction with a FOR-EACH-OBJECT loop, which causes every object to be read into memory sequentially, almost guaranteeing that the cache will overflow and cause disk accesses.

What can I do to increase the speed of publishing my store?

There are several techniques to use to help improve the speed of publishing:

  • Don’t repeat yourself – use WITH= to save the results of expensive operations where possible.
  • Try not to nest FOR-EACH-OBJECT loops. Sometimes it’s inevitable, due to the nature of what you’re trying to accomplish, just be aware of this, and use trick #1 when you need to get object information (such as @name, or @price) multiple times.
  • Try to keep your store hierarchy simple (see below)

I use the same templates for several stores. Why does one store publish faster than another?

Sometimes algorithms can be affected by the data. Take for instance multi-breadcrumbs. We’ve provided the operator GET-ALL-PATHS-TO in order to provide the fastest means of getting paths typically from INDEX -> id. The number of paths returned depends upon the data set.

single inheritance
Figure 1 – single inheritance (1 path per item) 

If all items and sections are only contained by one section or index, then the answer set is small. (See Figure 1)

multiple inheritance three levels
Figure 2 – multiple inheritance (3 paths)

If, however, a store has items listed in many sections, then the problem grows to be as many sections as each item is listed in. (See Figure 2)

multiple inheritances at multiple levels
Figure 3 – multiple inheritance at multiple levels (9 paths)

Progressing further, if sections are contained in other sections, and yet all paths lead upwards, the problem multiplies to be all combinations of sections leading up to the top element. (See Figure 3)

multiple inheritances with loops
Figure 4 – multiple inheritance with loops (585 paths)

The highest level of complexity is when there are “loops” in the hierarchy coupled with multiple sections leading to INDEX. If section A is contained in B, and B is contained in A, then the problem blows into the most complex yet, as it is each combination with 2 elements * each combination with 3 elements, etc up to the number of elements which are cross-referential. (See Figure 4)

This complexity also changes drastically with additional sections:

Number of sections Resulting Number of paths
6 585
7 3,192
8 31,312
9 274,000

Hopefully these tips will help you make changes to your templates to make them more efficient and quicker to publish. Stay tuned for more RTML tips in later posts.

Sheridan Rawlins
Yahoo! Small Business


3 Comments »

RSS feed for comments on this post.

  1. [...] Sheridan Rawlins, a Yahoo! Small Business engineer posted a great article on ystoreblog.com last week. He outlines the most common causes of slow Store Editor publishing, and more importantly, he outlines ways to resolve the issues. [...]

    Pingback by » Faster Publishing with Smarter RTML | My Store Solutions Blog — April 3, 2006 #

  2. What in the name of Jerry Brightonhammer was that all about?
    I dont’ know but it doesn’t make sense to me.

    Comment by JerryBrightonhammer — March 30, 2007 #

  3. Jerry

    RTML is really powerful (and some would say powerfully confusing at times). If the post didn’t make sense, I would suggest you get your feet wet with some simple RTML concepts first as this post was aimed at the RTML developer audience. Try experimenting in your store with your templates. You can try different operators to see what they do. Since you can’t edit your base templates, only edit copies of them, you can always revert if you make a mistake.

    Two other resources I would highly recommend are the RTML section of Don Cole’s Your Store Wizards forum. Merchants and developers post code samples and help each other work through programming issues there.

    The other must have resource is any of the RTML books produced by Istvan Siposs. He has produced multiple books including an introduction to RTML and more advanced books such as his reference to RTML. Merchants and developers alike swear by these resources.–Paul

    Comment by Administrator — April 2, 2007 #

Leave a comment

You must be logged in to post a comment.

Powered by WordPress on Yahoo! Web Hosting.
Copyright © 2006 Yahoo! Inc. All rights reserved. Privacy Policy - Terms of Service

order generic viagra accutane online find cheap viagra buy generic soma price of clomid cialis online cheap viagra drug drug cialis buying generic viagra pharmacy cialis buy cheapest viagra purchase soma viagra cost order cialis viagra for sale buy cialis purchase synthroid online generic zithromax viagra overnight shipping cheapest viagra online cheapest zithromax cheap cialis tablet buy viagra from india acomplia prescription buy viagra no prescription required levitra pharmacy buying generic cialis buy zithromax without prescription lasix online viagra buy online zithromax without a prescription buy cialis from canada purchase viagra overnight delivery cialis for sale levitra online stores buy acomplia without prescription cheap generic levitra cheap propecia online cheap price viagra buy cheap viagra internet synthroid pharmacy viagra online cheap cialis uk cheap viagra from uk cheapest generic cialis online buy cialis in canada accutane pharmacy find cialis no prescription required order acomplia cheapest propecia price of acomplia buy generic cialis viagra in bangkok buy cheap propecia online buy lasix purchase levitra online find cheap viagra online buy discount viagra online clomid pharmacy clomid without a prescription buy generic acomplia soma prices cheapest soma buy zithromax lasix prescription viagra discount levitra without a prescription buy zithromax cheap acomplia pills cheap accutane cheap viagra overnight delivery soma buy viagra us