Hello friends,

I am looking for some advice on JS performance.

I wrote a function in PHP that converts characters for large strings. Here is the entire array:

PHP Code:
    $table = array(
It removes the 'h' suffix and places a diacritic (dot) above the consonant for Irish words.

eg. 'lough' becomes 'louġ'; 'leprechaun' becomes 'lepreċaun'; 'Siobhán ' becomes 'Sioán'; and 'shamrock' becomes 'amrock'.

This was the way Irish words were written before the arrival of the typewriter to Ireland, and as the typewriter did not have a facility to place a dot above consonants, a 'h' suffix was used instead and has remained to this day. My PHP function above converts modern Irish words back to the traditional sort.

Anyway, I now want to do this with Javascript. As the average page contains about 15,000 characters, I was wondering what would be the most efficient way of doing this.

I tested the following jQuery functions, which seem to work, but I´m not sure how to add the entire array, and I´m not sure if it´s the most efficient way for 15,000 characters of text..

PHP Code:
PHP Code:
jQuery('html').each(function(i){ jQuery(this).text(jQuery(this).text().replace('ch','ċ')) }) 

Any tips would be great.