[ditz-talk] Is it just me or is rendering HTML really slow?

Pavel Shramov shramov at mexmat.net
Wed Nov 19 03:59:55 EST 2008

On Tue, Nov 18, 2008 at 10:12:15AM -0500, Matthew Wilson wrote:
> If you outline how to fix this, I'll try to work on it.
> I know I could compare timestamps of the original issue files versus
> their HTML representations, but that seems boring and possibly wrong.
Why wrong? It's not wrong for Makefile, caches and lots of other
software and here it's wrong? Modification time (mtime) is stable enough
on *nix like platforms since most of utilities preserve it. 
For example cp -a

$ cp -a /etc/fstab .
$ ls -l /etc/fstab fstab
-rw-r--r-- 1 root root 553 Apr 25  2008 /etc/fstab
-rw-r--r-- 1 psha psha 553 Apr 25  2008 fstab
$ python -c 'import sys, os; print [(x, os.path.getmtime(x)) for x in sys.argv[1:]];' /etc/fstab fstab 
[('/etc/fstab', 1209101686.0), ('fstab', 1209101686.0)]

At a first glance expression
 mtime(issue-html) >= max(mtime(issue-yaml), mtime(project.yaml))
is enough for skipping regeneration. You may replace mtime with
monotonic function of your choice but why not to use mtime?

Of course there have to be ability to force regeneration e.g. when
changes list of plugins or ditz templates. So adding option like --force
is useful.

Other way is (as mentioned by Christian) is to place some unique tag in
generated html but it's harder to implement and not better.


More information about the ditz-talk mailing list