This table has static row numbers via Template:Static row numbers.
Testing the sorting speed in the long table below. Sorting is very fast in the browsers I have used so far on a Windows 10 Pro desktop PC: Firefox, Chrome, Edge. Also, Safari (desktop view) on an iphone X.
See User:Timeshifter/Sandbox144 for all the links and explanatory notes.
Narrow your browser window until the country cells wrap to 2 or more lines. Note that the rows are still numbered correctly, even without class=nowrap.
The static row number column was created with the addition of just 2 things:
This table uses: class="wikitable sortable mw-datatable static-row-numbers"