Zakero:

> Did you check the execution time of the "find | sort" versus the
> "listfossil()"? Looking at your script, I think you can simplify it
> a bit.

The script takes between 1.2 and 1.8 seconds in the original form, and
between 130 and 160 ms if the `listfossil()' function is simplified to
just output the repository name (and not run the `./fossil --sql ...'
part).

> If using bash, every function call can spawn a sub-shell as well as
> "| while read". My knowledge on this may be outdated. The above will
> only spawn 1 sub-shell. By using "ls", the files will be sorted by
> name so the "find | sort" is not needed. All the repositories are
> passed at once, removing the need for the "| while read". Note that
> this will break if the length of all the filenames goes beyond the
> bash arg limit. This limit is between 1K and 8K characters, don't
> remember exactly.

Thanks for the interesting information. I have switched from `find
-exec' to `| while read' to avoid sub-shells (with custom functions),
but your approach with `for' seems to be another 10-20 ms faster (I
could even omit the custom function, as the program structure is much
simpler).

When replacing the calls to `./fossil' with `./sqlite3' (without any
further optimizations to the script), execution time drops from the
initial 1.2-1.8 seconds to 300-370 ms. So it seems that Fossil has to
perform more initialization work than the plain SQLite CLI program.

--Florian
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to