You will need to renew it either way because they will not put a visa on an expired document.
I would renew it before submitting the application, if I was in your place. The passport is the document you will need to send to get the visa, so it's best that the copies you send are of the document you will use to get into Canada.
If you renew it while in processing, you will have to notify CIC and VO and it may even delay the process. So I think it's best to do it in advance.