Shall I file a patent before publication?

Apart from patentability, market potential/marketability should be taken into consideration. As applying patent is a costly activity (e.g., typical cost for a US Non-Provisional Patent: HK$300,000 ‒ HK$500,000; PCT Application: HK$80,000 ‒ HK$100,000 (not including national phase entry) and Chinese Patent: HK$150,000 ‒ HK$250,000), it is encouraged to study the potential market size and value beforehand.