| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that we only need bare HTML files for .md files in news,
yet publish.sh creates them unconditionally. That is, we spend a lot
of time building bare HTML files that we never use.
This commit makes it so that bare HTML files are only generated for
news files, which speeds up the website build significantly:
$ /home/michael/benchmark.sh speed-up-build master
Already on 'speed-up-build'
NOW TESTING ON speed-up-build
0m08.24s real 0m08.53s user 0m05.57s system
0m08.21s real 0m08.39s user 0m05.58s system
0m08.26s real 0m08.23s user 0m05.70s system
0m08.26s real 0m08.27s user 0m05.91s system
0m08.24s real 0m08.36s user 0m05.63s system
0m08.28s real 0m08.40s user 0m05.67s system
0m08.29s real 0m08.21s user 0m05.83s system
0m08.23s real 0m08.12s user 0m05.80s system
0m08.32s real 0m08.32s user 0m05.75s system
0m08.30s real 0m08.40s user 0m05.61s system
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 33 commits.
NOW TESTING ON master
0m12.98s real 0m15.07s user 0m07.18s system
0m12.93s real 0m14.57s user 0m07.69s system
0m12.98s real 0m15.06s user 0m07.46s system
0m12.98s real 0m14.75s user 0m07.67s system
0m12.94s real 0m15.10s user 0m07.22s system
0m12.94s real 0m14.95s user 0m07.22s system
0m12.98s real 0m14.57s user 0m08.02s system
0m12.96s real 0m14.84s user 0m07.41s system
0m12.96s real 0m14.99s user 0m07.49s system
0m13.06s real 0m14.91s user 0m07.54s system
And here's the script in question, benchmark.sh:
#!/bin/sh
set -u
set -e
# usage: runit branch
runit() {
git checkout "$1"
echo
echo NOW TESTING ON "$1"
echo
for i in `jot 10`; do make clean >/dev/null; time make -j2 >/dev/null; done
}
make clean >/dev/null
for branch in "$@"
do
runit "$branch"
done
|
|
|
|
|
|
| |
Unlike what the comment says, the target .md.html does apply to
news/index.md (it's just that news/index.md must be generated first
by index.sh).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running index.sh on OpenBSD, the following error happens for
each item in the news/ directory (output is from "bash -x"):
+ touch -d '4 Jun 2017' news/andrew-robbins-new-maintainer.md
touch: out of range or illegal time specification: YYYY-MM-DDThh:mm:ss[.frac][Z]
This is because OpenBSD's touch(1) requires that the "d" flag's argument
be in ISO 8601 format, that is, "YYYY-MM-DDThh:mm:ss[.frac][Z]". This
could have been dealt with by converting the article date (determined
by "sed -n 3p $f | sed -e 's/^..//g'") to ISO 8601 format, then passing
the date to touch(1). That would have required even more code, so was
discarded as a possible solution.
Instead, we solve this by keeping a MANIFEST file under news/, which
is read to determine (a) which articles should be added to news/index.md,
and (b) in which order. This avoids the need for touch(1) altogether,
finally making the whole libreboot website build properly on OpenBSD.
This also allows a minor simplification in the Makefile.
|
|
This is done by replacing www/generate.sh with a Makefile. Benefits:
- Makes builds incremental, meaning that only the minimum number of
markdown files will be converted to HTML during a build. The previous
scheme always generated a new HTML file for every markdown file,
which is a big waste of time if only 1 or 2 markdown files have been
changed.
- Allows for much faster builds through concurrent jobs (e.g., via
"make -j4"). On my 4-core machine, my average build time for the
website with generate.sh was just over 26 seconds; with "make -j4",
it was 13 seconds.
- Avoids portability issues with find(1) in generate.sh, which I was
encountering on OpenBSD.
A note on portability: unlike GNU Make, OpenBSD's Make does not have
the "$(shell [commands])" construct, so we don't use that. Instead we
use "!= [commands]", which is supported by both.
|