Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Least efficient piece of CityScript?

Without it publishing my site (4,000+ pages) takes just under an hour, with it publishing takes hours and hours (can't be more precise, had to let it run overnight).

{$ foreach 1x in (folder "/some/Folder/*") $}
<a href="../index.html">index</a>
{$ endif $}

'/some/Folder/*' affects around 2600 articles.

This is a line of CityScript that has by far the biggest impact on publishing time that I have encountered until now.
Is there a specific reason for this? Is it just 'inefficient' to use wild cards this way?

Ronald Vogelaar

Saturday, August 07, 2004

ummm {blush} ...
My mistake, I meant it to function like:

->if currentfolder is "/some/folder/*"
then insert some code....
{$ endif $}

which obviously doesn't work and so, the code I wanted inserted in only the articles that met the condition "/some/Folder/*" were actually ... inserted in all articles that used that specific template.

Saturday, August 07, 2004

My largest site has only about a thousand total and it has passed the limit of what I consider to be acceptable waiting time.  I haven't heard of anyone with a CityDesk site as large as yours (if there is maybe they can provide you feedback).  Performance of large sites has long been a problem.  Maybe Fog Creek is working on bettering performance for the next version (we'll have to wait to find out).

Have you considered breaking your site down into several .cty files?

David Burch
Saturday, August 07, 2004

I had one >>1000 article site that had a messy script build up. I had scripts that generated monthly performance archives. Each one of the pages linked here had a script than ran every time I published:
It was really much worse than I'm revealing.

I had a BFO that the schedule for January 2001
would never change. So each month I do a preview of the past month's archive, copy the resulting page, and paste the results over the page with the script. The script makes sense during the current month because I add performances as I go. But once it's over, it's over.

Publsh times went from miserable to almost unnoticible.
(BFO - Blinding Flash of the Obvious)

Saturday, August 07, 2004

Maybe you can use templates to insert that code instead of an if condition? That might speed things up a bit. Just make a duplicate template with that modified piece of code.

Yes you'll have to edit each article in that folder but...

What's the desired effect? Don't give us the script, give us what you want it to do in the real world, and maybe we can help you troubleshoot a bit more.
Sunday, August 08, 2004

Yes, it's become pretty big, 4,094 web pages right now.... and thousands more to come.

I did consider using one cty file per language, or sweep those language parts of my site with relatively few pages (German, Finnish, Italian) together and just keep separate ones for the larger parts (Dutch, English, French).
I chose not to because I thought it would make it easier to keep them all together, plus I could not foresee CityDesk would have problems with so many articles.

Splitting it up now: I'm not sure that's possible. If I could drag and drop between two cty files I might consider it, but then again, I can just work on adding pages and hit publish when I go to bed. Just as long as it's finished when I wake up.

What I wanted to do with my script was the following:
I wanted all articles that are located in subfolders from /some/folder/ to have a link back to an indx.html that is located one level up, thus: <a href="../index.html">Go back</a>

I had resigned to the possibility that I would have to wait for CityDesk 3 to do this in an easy way, but if there's anyone out here that has a bright idea I'm all ears... eyes..., whatever.

Thanks in advance,

Ronald Vogelaar

Tuesday, August 10, 2004

tk: I might be able to use your suggestion (preview, copy and paste) on a number of menu generating scripts.

Thanks for the hint,

Ronald Vogelaar

Tuesday, August 10, 2004

:-) Something in there might help you do what you want.
Tuesday, August 10, 2004

Yeah it might,
I downloaded and tried it, until the trial period was over. Just can't afford to shell out $49 right now.


Wednesday, August 11, 2004

*  Recent Topics

*  Fog Creek Home