-
Bug
-
Resolution: Fixed
-
Major
-
2.2.1, 2.3
-
64bit Linux - Debian Squeeze
Note, Debian uses glibc for iconv_substr; MacOS uses libiconv which is apparently far more efficient
-
MOODLE_22_STABLE, MOODLE_23_STABLE
-
MOODLE_22_STABLE
-
w03_
MDL-31142_m23_slowiconv -
We noticed this when looking at an issue with timeouts in the rss_client block.
The failure we were seeing was caused by the rss_client block calling lib/web.php->break_up_long_words($description, 30) where $description was a string of around 4,600 characters.
break_up_long_words() instantiates a new textlib class and calls $textlib->substr on each character in turn; which in turn performs an iconv_substr on the supplied text.
Effectively, the code is calling:
$strlen = $textlib->strlen($text);
|
for ($i = 0; $i < $strlen; $i++) {
|
$foo += $textlib->substr($text, $i, 1);
|
}
|
I'll attach some code which demonstrates the performance compared with mb_string()