mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Let wuffs-c take a no-op C formatter
Reinforcing the previous commit's (e5cc4a42) observation, over 93% of
compilation time (converting foo.wuffs into foo.c) is spent piping the
generated C code through clang-format.
----
$ time wuffs gen -cformatter=clang-format-5.0 > /dev/null
real 0m2.855s
user 0m2.680s
sys 0m0.286s
$ time wuffs gen -cformatter= > /dev/null
real 0m0.175s
user 0m0.172s
sys 0m0.050s
----
This commit is contained in:
1 parent
e5cc4a42e4
commit
ddc8973ef0
5 files changed
+17
-5
No files matched your search
@@ -137,6 +137,11 @@ func doGenrelease(args []string) error {
|
||||
now = time.Now()
|
||||
}
|
||||
|
||||
if *cformatterFlag == "" {
|
||||
os.Stdout.Write(unformatted.Bytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
cmd := exec.Command(*cformatterFlag, "-style=Chromium")
|
||||
cmd.Stdin = unformatted
|
||||
cmd.Stdout = os.Stdout
|
||||
|
||||
Reference in new issue
Block a user