amp-toolbox-php icon indicating copy to clipboard operation
amp-toolbox-php copied to clipboard

mb_detect_encoding is very slow

Open schlessera opened this issue 3 years ago • 3 comments

Profiling the current test suite showed that the use of mb_detect_encoding() made up more than 40% of the execution time of the entire test suite.

We should:

  • [ ] ensure we only use it if really necessary to decrease the amount of times it runs
  • [x] document that it is slow and that documents should therefore use a proper charset meta tag to begin with
  • [ ] make sure a charset is set in integration like the WP plugin to avoid its use altogether in those cases

schlessera avatar Mar 04 '21 18:03 schlessera