❯ for i in$(seq 110); dotime zsh -i -c exit; done
zsh -i -c exit0.79s user 0.40s system 108% cpu 1.100 total
zsh -i -c exit0.78s user 0.39s system 108% cpu 1.070 total
zsh -i -c exit0.77s user 0.39s system 108% cpu 1.069 total
zsh -i -c exit0.79s user 0.39s system 109% cpu 1.083 total
zsh -i -c exit0.78s user 0.38s system 108% cpu 1.065 total
zsh -i -c exit0.80s user 0.40s system 108% cpu 1.099 total
zsh -i -c exit0.79s user 0.40s system 109% cpu 1.090 total
zsh -i -c exit0.80s user 0.40s system 107% cpu 1.110 total
zsh -i -c exit0.79s user 0.40s system 108% cpu 1.100 total
zsh -i -c exit0.80s user 0.40s system 108% cpu 1.100 total
今回
前回同様まずはおおまかな起動時間を測ってみた。
$ for i in$(seq 110); dotime zsh -i -c exit; done
zsh -i -c exit0.49s user 0.25s system 109% cpu 0.676 total
zsh -i -c exit0.48s user 0.23s system 109% cpu 0.650 total
zsh -i -c exit0.49s user 0.24s system 109% cpu 0.661 total
zsh -i -c exit0.48s user 0.24s system 110% cpu 0.658 total
zsh -i -c exit0.48s user 0.23s system 110% cpu 0.648 total
zsh -i -c exit0.49s user 0.24s system 111% cpu 0.651 total
zsh -i -c exit0.48s user 0.24s system 110% cpu 0.649 total
zsh -i -c exit0.48s user 0.24s system 110% cpu 0.652 total
zsh -i -c exit0.48s user 0.23s system 110% cpu 0.643 total
zsh -i -c exit0.49s user 0.24s system 110% cpu 0.654 total
$ for i in$(seq 110); dotime zsh -i -c exit; done
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.420 total
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.420 total
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.421 total
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.423 total
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.419 total
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.419 total
zsh -i -c exit0.21s user 0.20s system 95% cpu 0.421 total
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.417 total
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.419 total
zsh -i -c exit0.20s user 0.20s system 95% cpu 0.422 total
defread_image
download_blob_to_tempfile do |file|
require"mini_magick"
image = MiniMagick::Image.new(file.path)
if image.valid?
yield image
else
logger.info "Skipping image analysis because ImageMagick doesn't support the file"
{}
endendrescueLoadError
logger.info "Skipping image analysis because the mini_magick gem isn't installed"
{}
rescueMiniMagick::Error => error
logger.error "Skipping image analysis due to an ImageMagick error: #{error.message}"
{}
end