So, I did some math on this, using a 6th-level battlemaster--the earliest point that you can get two feats without being VH.
TL;DR RESULT:
- A crossbow expert/sharpshooter fighter deals about 15% more damage than a greatsword fighter with no feats.
- This is more than offset by +1d4 damage on the greatsword fighter's main weapon.
ASSUMPTIONS:
- Comparing a 6th-level fighter with no feats and a greatsword, to a fighter with SS, Crossbow Expert, and a hand crossbow.
- No Variant Human for this comparison. The crossbow fighter has Dex 16, the greatsword fighter has Str 20.
- Each fighter will select a fighting style and a maneuver that optimizes their damage output. The greatsword fighter will pick Great Weapon style and Riposte; the crossbow fighter will pick Archery style and Precision Attack.
- The typical chance to hit, for a PC who starts with attack stat 16 and pumps it at levels 4 and 8, with no other modifiers, is 65%.
- The "adventuring day" consists of 21 combat rounds (~7 combats, ~3 rounds per combat) and includes 2 short rests. (This is highly campaign-dependent, of course, but I'm going off DMG guidelines here.) Thus, you get 7 combat rounds between rests.
- The AC of the enemy can be accurately guessed, allowing the crossbow fighter to optimize their use of PA.
- 50% of combats, the greatsword fighter has to use javelins on the first round while closing to melee.
Precision Attack: The math is a bit tricky on Precision Attack, because - unlike most such abilities, where you know in advance exactly how much it will boost your attack roll - PA involves a second die roll. If you miss by 3, and you throw your PA and roll a 2, you wasted the die. On the other hand, any time you get to your next short rest with superiority dice unused, those dice are also wasted. So there is a bit of strategizing around when you should throw a PA versus holding it for a better chance.
For a 6th-level fighter making 3 attacks/round, with the above assumptions, the optimal use of PA - i.e., the largest number of misses-converted-to-hits - is to use PA when you miss by 4 or less*. This results in 3.25 misses converted to hits per short rest.
Riposte: A greatsword fighter is going to be in the thick of things and should have no shortage of opportunities to Riposte. This means 4 Riposte attacks, translating into 2.8 hits per short rest; each of those hits gets 1d8 bonus damage.
(Riposte is better than PA for the greatsword fighter because a) the greatsword fighter has only 2 attacks per round, forcing them to use PA more aggressively and increase the chance of wastage, and b) the bonus damage die on Riposte increases the value of each hit. Together, these factors put Riposte ahead.)
Other Notes:
- The greatsword fighter's hit chance is 70% (Str 20 at 6th level is ahead of the curve). The sharpshooter fighter's hit chance is 45% (60% for Dex 16 at 6th level, +10% for Archery, -25% for Sharpshooter).
- The greatsword fighter's Riposte attacks have the same chance to crit as any other attack. The sharpshooter's "extra hits" from PA cannot crit.
- Action Surge gives each fighter 2 extra attacks per short rest. This is a modest advantage to the greatsword fighter, since 2 extra attacks is a full round for them but only 2/3 of a round for the sharpshooter.
- Per Jeremy Crawford, superiority dice are not doubled on a crit. If you ask me, this is in conflict with RAW, but I went with Crawford's ruling.
Outcome:
- Crossbow fighter deals ~228 damage per short rest.
- Greatsword fighter deals ~199 damage per short rest.
- If you give the greatsword fighter a sword with +1d4 damage, it jacks them up to ~239 per short rest. (Remember that the d4 benefits from Great Weapon style, so it's +3 damage instead of +2.5, and it's also doubled on a crit. However, it doesn't affect javelin attacks.)
*A more sophisticated strategy might take into account how far into the adventure you are, starting conservative and becoming more aggressive if you have dice unspent later on. However, I doubt it would make a big difference.