Skip to content
  • Tim Hunt's avatar
    e47a7b90
    MDL-39378 Improve s() performance. · e47a7b90
    Tim Hunt authored
    These changes give about a 10% speed-up in this function. The significant changes are:
    1. Simplify the if logic to remove unnecssary cases.
    2. Dont pass default argument values to htmlspecialchars, just using the
       defaults is faster.
    3. I can confirm that /i regex is faster than the equivalent regex without the i.
    
    I also added more unit tests to test the edge cases.
    e47a7b90
    MDL-39378 Improve s() performance.
    Tim Hunt authored
    These changes give about a 10% speed-up in this function. The significant changes are:
    1. Simplify the if logic to remove unnecssary cases.
    2. Dont pass default argument values to htmlspecialchars, just using the
       defaults is faster.
    3. I can confirm that /i regex is faster than the equivalent regex without the i.
    
    I also added more unit tests to test the edge cases.
Loading