Menu

#15 Incremental build of forest

Next Release
open
performance (2)
3
2008-04-17
2007-12-22
No

plantforest currently rebuilds the whole forest file from scratch whenever it's invoked.

If we are editing some kelp file (new or existing), and we want to run kelp at the same time, if we want kelp to know about the latest changes we need to run plantforest first, and then kelp.

In a shell script this is easy to do and therefore doesn't call for any additional functionality in kelp.
It is though a waste of time to have plantforest regenerate the whole forest file after a little change.

If we add an option to plantforest, say '-u arg', where arg is optional, we can tell plantforest that we only want to update the forest with any new content, not regenerate the forest file.

If we give an argument to option '-u' we can instead specify a particular kelp file we want to force-update: combined with a makefile system, this would provide an increase in the tool's performance.

When running kelp, from the shell we can always optionally call a combination of 'plantforest -u' and 'kelp ...'

What we need is to make sure that we fstat the files and pick up any new ones and changed ones.
This would require a change in the forest file format to store the date of the files.

Plantforest would also need to rebuild the forest from the forest file in memory, update the changed modules and rewrite the file out.

Since the real bottleneck in plantforest is parsing the file's contents, this improvement alone would help Kelp cope with huge projects with minimal effort.

Discussion

  • Anonymous

    Anonymous - 2007-12-29

    Logged In: YES
    user_id=1159546
    Originator: YES

    An idea I had today is to change the structure from being a single forest file, to having a .kelp.idx file for every .kelp file.
    The .idx file is basically the index of that kelp module, and thanks to the file system it has a date and time.It makes it easier to modify the forest because the forest is not just one file, but several, and each one can be updated separately.
    It makes it transparent for use in Makefiles too.

     
  • Anonymous

    Anonymous - 2008-01-15

    Logged In: YES
    user_id=1159546
    Originator: YES

    The time stamp of the .kelp file is stored in the .kelp.idx file in order to ensure version compatibility at file system level.
    We could also ask for a VERSION attribute in the .kelp file but that would be excessive.

     
  • Anonymous

    Anonymous - 2008-02-07

    Logged In: YES
    user_id=1159546
    Originator: YES

    We should use extension .kelp.iod (iodine) for index files.

     
  • Anonymous

    Anonymous - 2008-04-17
    • priority: 7 --> 8
     
  • Anonymous

    Anonymous - 2008-04-17
    • priority: 8 --> 3
     

Log in to post a comment.