All decisions involve balancing cost, benefit and risk. Upgrading (making small improvements) involves smaller costs and benefits, but there is very little risk of making things worse.
Buying a new bike will cost more all at once, may not improve things and may have cause other problems (like theft risk). Also note that if you use a bike alot even a new bike will likely start to need upgrades as no stock bike is perfect.
If your frame is wrong, the wheel size is wrong, you need a fancy suspension system, or other large changes your best bet is a new bike.