ampproject / ampproject/amp-toolbox-php

mb_detect_encoding is very slow

Open
#90 3 comments 0 reactions 1 assignee Claimed by @ediamin View on GitHub
DOM Good First Issue Performance
Dominant language
PHP
Stars
74
Forks
25
Avg merge
1d 15h
Merged PRs (30d)
3

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.