Skip to content

Instantly share code, notes, and snippets.

@wilzbach
Last active February 11, 2019 13:28
Show Gist options
  • Save wilzbach/afb9f2edec8ddfabfdd6becec55e62a7 to your computer and use it in GitHub Desktop.
Save wilzbach/afb9f2edec8ddfabfdd6becec55e62a7 to your computer and use it in GitHub Desktop.
Measure import time for each module in Phobos
module bare import time
std.regex 1.04s
std.net.curl 0.29s
std.zip 0.19s
std.path 0.15s
std.socket 0.15s
std.file 0.14s
std.mmfile 0.14s
std.datetime 0.14s
std.string 0.12s
std.encoding 0.12s
std.uni 0.09s
std.concurrency 0.09s
std.process 0.05s
std.zlib 0.04s
std.getopt 0.04s
std.bigint 0.04s
std.numeric 0.04s
std.algorithm 0.04s
std.uuid 0.03s
std.stdio 0.03s
std.range 0.03s
std.variant 0.03s
std.bitmanip 0.03s
std.parallelism 0.03s
std.utf 0.02s
std.csv 0.02s
std.json 0.02s
std.array 0.02s
std.signals 0.02s
std.complex 0.02s
std.typecons 0.02s
std.container 0.02s
std.mathspecial 0.02s
std.xml 0.01s
std.uri 0.01s
std.meta 0.01s
std.math 0.01s
std.conv 0.01s
std.traits 0.01s
std.stdint 0.01s
std.random 0.01s
std.format 0.01s
std.digest 0.01s
std.base64 0.01s
std.exception 0.01s
std.functional 0.01s
std.ascii 0.00s
std.system 0.00s
std.demangle 0.00s
std.compiler 0.00s
std.outbuffer 0.00s
modules=(
"std.algorithm" \
"std.array" \
"std.ascii" \
"std.base64" \
"std.bigint" \
"std.bitmanip" \
"std.compiler" \
"std.complex" \
"std.concurrency" \
"std.container" \
"std.conv" \
"std.csv" \
"std.datetime" \
"std.demangle" \
"std.digest" \
"std.encoding" \
"std.exception" \
"std.file" \
"std.format" \
"std.functional" \
"std.getopt" \
"std.json" \
"std.math" \
"std.mathspecial" \
"std.meta" \
"std.mmfile" \
"std.net.curl" \
"std.numeric" \
"std.outbuffer" \
"std.parallelism" \
"std.path" \
"std.process" \
"std.random" \
"std.range" \
"std.regex" \
"std.signals" \
"std.socket" \
"std.stdint" \
"std.stdio" \
"std.string" \
"std.system" \
"std.traits" \
"std.typecons" \
"std.uni" \
"std.uri" \
"std.utf" \
"std.uuid" \
"std.variant" \
"std.xml" \
"std.zip" \
"std.zlib" \
)
echo "module | bare import time"
echo "-------------------|-----------------"
(for module in "${modules[@]}" ; do
echo "import ${module};" > "test.d"
usedTime=$(/usr/bin/time -f "%e" dmd -c -o- test.d 2>&1 | xargs echo -n)
printf "%-18s | %s\n" "${module}" "${usedTime}s"
done) | sort -k2 -r
rm -f test.d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment