Skip to content

Commit 34ecd5d

Browse files
committed
[Nerdsniped] use significant parallelism for warmup IO
- This will let the OS disk scheduler seek efficiently
1 parent 6a3aee6 commit 34ecd5d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

makexpi.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -o errexit
33
APP_NAME=https-everywhere
44

@@ -52,11 +52,15 @@ if [ -n "$1" ] && [ "$2" != "--no-recurse" ] && [ "$1" != "--fast" ] ; then
5252
fi
5353

5454
if [ "$1" != "--fast" -o ! -f "$RULESETS_SQLITE" ] ; then
55+
5556
# This is an optimization to get the OS reading the rulesets into RAM ASAP;
56-
# it's useful on machines with slow disk seek times; there might be something
57-
# better (vmtouch? readahead?) that tells the IO subsystem to read the files
58-
# in whatever order it wants...
59-
nohup cat src/chrome/content/rules/*.xml >/dev/null 2>/dev/null &
57+
# it's useful on machines with slow disk seek times; doing several of these
58+
# at once allows the IO subsystem to seek more efficiently. Note that
59+
# bash uses the completely insane glob ordering aAbBcC...
60+
for firstchar in `echo {a..z} {A..Z} {0..9}` ; do
61+
# Those cover everything but it wouldn't matter if they didn't
62+
nohup cat src/chrome/content/rules/"$firstchar"*.xml >/dev/null 2>/dev/null &
63+
done
6064

6165
echo "Generating sqlite DB"
6266
python2.7 ./utils/make-sqlite.py

0 commit comments

Comments
 (0)