더북(TheBook)

이렇게 바꾸고 나면 adjust 명령은 초기화 시 enhance 모듈을 로드하지 않기 때문에 아주 빠르게 실행된다.

$ time python3 ./mycli_faster.py my_file.jpg adjust --brightness .3 --contrast -0.1 
...
real   0m0.049s
user   0m0.032s
sys    0m0.013s

그렇지만 enhance 명령은 이전과 마찬가지로 여전히 느리다.

$ time python3 ./mycli_faster.py my_file.jpg enhance --amount 0.8...
...
real   0m1.049s
user   0m0.032s
sys    0m0.013s