When overtaking a heavy truck you should normally begin the manoeuvre far behind the truck. This is called a flying overtake. Flying overtakes are faster and give you better visibility ahead and more opportunity to abort the overtake if needed.
Flying overtakes are considered safer than accelerating overtakes in most situations, regardless of what type of vehicle you are overtaking.