My Dockerfile is as flows and the output image size is 523M
FROM alpine AS buildc
RUN apk add --no-cache build-base
RUN echo -e "#include <stdio.h>\nint main(int ac, char *av[]){printf(\"hello c\\\\n\");return 0;}" | tee /hello.c
COPY . /foo
RUN gcc -o /a.out /hello.c
# the COPY above SHOULD NOT invalidate the cache for the buildgo stage.
FROM alpine AS buildgo
RUN apk add --no-cache build-base
RUN apk add --no-cache go
RUN echo -e "package main\nfunc main(){println(\"hello go\")}" | tee /hello.go
RUN go build -o /a.out /hello.go
time builadh bud -f Dockerfile
It cost 1m28s with buildah.
time docker build --no-cache -f Dockerfile .
It cost 39s with docker.
We also analysize the buildah with pprof and find it cost a lot of time call io.Copy and sha256.Write. Statistics indicate that it call sha256.Write more than one hundred thousand in the build. For build a large image, may be use io.CopyBuffer with a reasonable buffer can relieve this problem.

@zvier thanks very much for the very thorough problem report. I know @nalind has been working feverishly on making the builds faster, so I'll ask him to comment on that status.
@TomSweeneyRedHat @nalind
could you please share your updates here? many thanks~
@jingxiaolu There has been a full rewrite of the COPY code, we would love to have you run your analysys on the master branch or v1.16.2 to see how much it has improved.
@rhatdan thanks very much for your update!
@zvier please~
@jingxiaolu There has been a full rewrite of the COPY code, we would love to have you run your analysys on the master branch or v1.16.2 to see how much it has improved.
Fantastic job ,20s in my environment with this new version, about 19s more faster than docker.
@zvier thanks very much for the follow-up. I'm so glad the changes were successful for your environment.
Most helpful comment
Fantastic job ,20s in my environment with this new version, about 19s more faster than docker.