Currently, the <math /> tag in MediaWiki supports linking to other articles only for very simple attributes. For example, in the formula a + b = c^d, links can be created for individual elements like a, b, c, and d, but not for more complex expressions like c^d or a + b.
Description
Details
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | Feature | None | T388985 Add support for more complex linking in <math/> formulas | ||
| Resolved | FrederikHennecke1 | T389461 wikitexvc should create a tree instead of a string | |||
| Resolved | FrederikHennecke1 | T389712 Make MMLbase support trees | |||
| Open | None | T414289 Use mrow elements for linking instead of anchor tags |
Event Timeline
Change #1128019 had a related patch set uploaded (by FrederikHennecke1; author: FrederikHennecke1):
[mediawiki/extensions/Math@master] Add support for more complex linking in <math/> formulas
I propose the following changes for this task:
Commit 1: Move linking logic to MMLbase
Currently, we have the core logic for linking in MathNativeMML. We should move it to MMLbase so that we can use the caching in the second commit.
Changes:
- Refactor link-handling code into MMLbase class
- Preserve existing linking functionality without optimizations
- Add basic tests for MMLbase linking methods
Commit 2: Implement LocalChecker caching with links
Right now, only the base MathML is getting cached, and whenever we need to add the linking, we have to recompute it.
Changes:
- Modify LocalChecker to inject links into MathML after cache lookup
- Add tests verifying:
- Link persistence through caching
- Correct link rendering in checker output
- Cache hit/miss behavior with links
Commit 3: Optimize with subtree hashing + Firefox fix
Currently, the <math /> tag in MediaWiki supports linking only for very simple attributes. For example, in the formula a + b = c^d, links can be created for individual elements like a`, b, c, and d but not for more complex expressions like c^d or a + b. I propose we use subtree hashing to find the correct subtree and add a new MMLanchor (just a normal <a href=...>) element to it.
Changes:
- Implement subtree hashing in MMLbase
- Use hashes for faster link/formula matching (Merkle tree hashing)
- Add hash collision tests in MMLbase tests
- While we are at it, add a fix for T402358
Thank you that’s a great plan. However I think it’s most effective if we discuss the caching and rendering question a bit more in detail before proceeding with the implementation.
- do we have current measurements of the performance and the impact of caching?
- can we estimate how the proposed changes would affect the performance? (Now, we have almost no qid / vs future with x % qid)
- can we generate a code pen, with a few complex and simple examples that demonstrates how the rendering will look like when implementation is done. That would help us to test the impact on even individual browsers.
One of the open questions for me is how to do linking. There are quite complex, MathML core-compliant solutions that use a tags. However, this requires the addition of a foreign tag to the MathML tree (as you demonstrated in your previous commit). Instead, I'd recommend being a bit more flexible and just use href from the full spec and use a polyfill (JavaScript) for the linking without introducing a new element to the DOM. I think this would be much more elegant, and the downside that people without JS and with browsers that only support core won't get links. I think that's acceptable. At least the href element is supported by FF, Safari https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Global_attributes/href (and MathJax)
- I don't think so. We only store strings instead of the MMLbase tree as that's the recommended way: https://www.mediawiki.org/wiki/Object_cache . If we have to add the QID, then we have to either recompute the MMLbase tree for subtree matching to add the anchor tag or do subtree matching in the DOM, which is more complicated.
- Can't really say as I don't know much about the caching performance itself.
- It should be easy if it is only about rendering. We could add anchor tags in random placed in the formula tree and then compare it with the default rendering.
This sounds like a good idea. How about: instead of adding a new anchor tag, like in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/1180252, we just add the href (and maybe title) to the correct MathML elements and add a polyfill to make the links work in chromium and other browsers.
Change #1188775 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):
[mediawiki/extensions/MathSearch@master] Fix performance tests
This sounds like a good idea. How about: instead of adding a new anchor tag, like in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/1180252, we just add the href (and maybe title) to the correct MathML elements and add a polyfill to make the links work in Chromium and other browsers.
This seems the best solution to me.
Change #1188775 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):
[mediawiki/extensions/MathSearch@master] Fix performance tests
Change #1188775 merged by jenkins-bot:
[mediawiki/extensions/MathSearch@master] Fix performance tests
Re-caching. I'll investigate. My feeling is that we might get around caching altogether. For the average case, the most time-consuming phase is the checking phase. Here, we might be able to improve performance just by updating the library. We could not do that before, because the new version requires PHP 8. However, a typical rendering time for a random formula is about 1ms. Some exceptional cases such as
\begin{pmatrix}
360 & 0,032 & -0,012 & 0,980 & 0,00001 & 0,00633 & 0,00005 & -0,00002 & 0,00155 & 0,17559 & 0,00535 & 0,81907 \\
365 & 0,031 & -0,012 & 0,981 & 0,00001 & 0,00617 & 0,00005 & -0,00002 & 0,00159 & 0,17526 & 0,00520 & 0,81953 \\
370 & 0,030 & -0,012 & 0,982 & 0,00001 & 0,00600 & 0,00005 & -0,00002 & 0,00164 & 0,17494 & 0,00506 & 0,82000 \\
375 & 0,029 & -0,012 & 0,983 & 0,00002 & 0,00583 & 0,00011 & -0,00004 & 0,00337 & 0,17565 & 0,00603 & 0,81831 \\
380 & 0,027 & -0,012 & 0,984 & 0,00004 & 0,00549 & 0,00019 & -0,00009 & 0,00699 & 0,17398 & 0,00463 & 0,82139 \\
385 & 0,027 & -0,012 & 0,984 & 0,00006 & 0,00549 & 0,00031 & -0,00014 & 0,01147 & 0,17398 & 0,00463 & 0,82139 \\
390 & 0,026 & -0,011 & 0,985 & 0,00012 & 0,00614 & 0,00051 & -0,00022 & 0,01927 & 0,17375 & 0,00517 & 0,82108 \\
395 & 0,026 & -0,011 & 0,986 & 0,00022 & 0,00615 & 0,00092 & -0,00039 & 0,03481 & 0,17374 & 0,00517 & 0,82109 \\
400 & 0,025 & -0,011 & 0,986 & 0,00040 & 0,00597 & 0,00166 & -0,00073 & 0,06541 & 0,17343 & 0,00502 & 0,82155 \\
405 & 0,024 & -0,011 & 0,987 & 0,00064 & 0,00580 & 0,00265 & -0,00121 & 0,10886 & 0,17311 & 0,00488 & 0,82201 \\
410 & 0,022 & -0,011 & 0,988 & 0,00121 & 0,00546 & 0,00488 & -0,00244 & 0,21898 & 0,17247 & 0,00459 & 0,82294 \\
415 & 0,021 & -0,010 & 0,990 & 0,00218 & 0,00612 & 0,00749 & -0,00356 & 0,35287 & 0,17224 & 0,00513 & 0,82263 \\
420 & 0,018 & -0,010 & 0,991 & 0,00400 & 0,00560 & 0,01287 & -0,00715 & 0,70839 & 0,17129 & 0,00470 & 0,82401 \\
425 & 0,014 & -0,008 & 0,993 & 0,00730 & 0,00653 & 0,01564 & -0,00894 & 1,10942 & 0,17021 & 0,00548 & 0,82431 \\
430 & 0,009 & -0,005 & 0,996 & 0,01160 & 0,00812 & 0,01286 & -0,00714 & 1,42317 & 0,16892 & 0,00679 & 0,82429 \\
435 & 0,001 & -0,001 & 0,999 & 0,01684 & 0,00998 & 0,00169 & -0,00169 & 1,68502 & 0,16679 & 0,00833 & 0,82488 \\
440 & -0,008 & 0,005 & 1,004 & 0,02300 & 0,01332 & -0,01382 & 0,00863 & 1,73380 & 0,16457 & 0,01105 & 0,82439 \\
445 & -0,021 & 0,012 & 1,009 & 0,02980 & 0,01676 & -0,03734 & 0,02134 & 1,79425 & 0,16121 & 0,01384 & 0,82495 \\
450 & -0,039 & 0,022 & 1,017 & 0,03800 & 0,02178 & -0,06804 & 0,03838 & 1,77424 & 0,15666 & 0,01785 & 0,82549 \\
455 & -0,062 & 0,034 & 1,027 & 0,04800 & 0,02757 & -0,10796 & 0,05920 & 1,78826 & 0,15084 & 0,02241 & 0,82675 \\
460 & -0,091 & 0,052 & 1,039 & 0,06000 & 0,03719 & -0,14683 & 0,08390 & 1,67648 & 0,14397 & 0,02985 & 0,82618 \\
465 & -0,128 & 0,076 & 1,052 & 0,07390 & 0,05027 & -0,18816 & 0,11172 & 1,54641 & 0,13550 & 0,03978 & 0,82472 \\
470 & -0,182 & 0,117 & 1,064 & 0,09098 & 0,07415 & -0,22330 & 0,14355 & 1,30545 & 0,12408 & 0,05755 & 0,81837 \\
475 & -0,258 & 0,184 & 1,074 & 0,11260 & 0,11524 & -0,25209 & 0,17978 & 1,04940 & 0,10969 & 0,08692 & 0,80339 \\
480 & -0,366 & 0,290 & 1,076 & 0,13900 & 0,18226 & -0,27912 & 0,22116 & 0,82060 & 0,09138 & 0,13244 & 0,77617 \\
485 & -0,519 & 0,457 & 1,063 & 0,16930 & 0,29072 & -0,30224 & 0,26613 & 0,61904 & 0,06905 & 0,20083 & 0,73012 \\
490 & -0,714 & 0,699 & 1,015 & 0,20800 & 0,45230 & -0,32835 & 0,32145 & 0,46677 & 0,04552 & 0,29486 & 0,65962 \\
495 & -0,945 & 1,024 & 0,920 & 0,25860 & 0,67444 & -0,36234 & 0,39263 & 0,35275 & 0,02350 & 0,41279 & 0,56372 \\
500 & -1,166 & 1,389 & 0,777 & 0,32300 & 0,93034 & -0,40482 & 0,48224 & 0,26976 & 0,00848 & 0,53836 & 0,45317 \\
505 & -1,349 & 1,744 & 0,606 & 0,40730 & 1,18453 & -0,46385 & 0,59967 & 0,20837 & 0,00046 & 0,65707 & 0,34247 \\
510 & -1,335 & 1,930 & 0,405 & 0,50300 & 1,33598 & -0,50263 & 0,72665 & 0,15248 & 0,01412 & 0,74997 & 0,23591 \\
515 & -1,205 & 1,968 & 0,237 & 0,60820 & 1,38807 & -0,52798 & 0,86230 & 0,10384 & 0,03921 & 0,81202 & 0,14877 \\
520 & -0,981 & 1,852 & 0,129 & 0,71000 & 1,33233 & -0,52278 & 0,98693 & 0,06874 & 0,07462 & 0,83386 & 0,09152 \\
525 & -0,737 & 1,665 & 0,072 & 0,79320 & 1,22298 & -0,47800 & 1,07988 & 0,04670 & 0,11445 & 0,82615 & 0,05940 \\
530 & -0,515 & 1,475 & 0,040 & 0,86200 & 1,10758 & -0,40081 & 1,14796 & 0,03113 & 0,15486 & 0,80561 & 0,03953 \\
535 & -0,330 & 1,310 & 0,020 & 0,91490 & 1,00606 & -0,30010 & 1,19130 & 0,01819 & 0,19295 & 0,78149 & 0,02556 \\
540 & -0,170 & 1,162 & 0,008 & 0,95400 & 0,91401 & -0,17744 & 1,21284 & 0,00835 & 0,22979 & 0,75409 & 0,01612 \\
545 & -0,029 & 1,028 & 0,001 & 0,98030 & 0,83003 & -0,03425 & 1,21412 & 0,00118 & 0,26586 & 0,72430 & 0,00983 \\
550 & 0,098 & 0,905 & -0,003 & 0,99500 & 0,75253 & 0,12958 & 1,19659 & -0,00397 & 0,30184 & 0,69257 & 0,00560 \\
555 & 0,212 & 0,792 & -0,004 & 1,00000 & 0,68090 & 0,31135 & 1,16317 & -0,00587 & 0,33731 & 0,65885 & 0,00383 \\
560 & 0,318 & 0,688 & -0,005 & 0,99500 & 0,61515 & 0,51436 & 1,11283 & -0,00809 & 0,37364 & 0,62441 & 0,00196 \\
565 & 0,411 & 0,593 & -0,004 & 0,97860 & 0,55445 & 0,72542 & 1,04665 & -0,00706 & 0,40859 & 0,58931 & 0,00209 \\
570 & 0,497 & 0,507 & -0,004 & 0,95200 & 0,49980 & 0,94667 & 0,96572 & -0,00762 & 0,44393 & 0,55483 & 0,00123 \\
575 & 0,575 & 0,428 & -0,003 & 0,91540 & 0,44943 & 1,17115 & 0,87175 & -0,00611 & 0,47865 & 0,51983 & 0,00152 \\
580 & 0,645 & 0,358 & -0,002 & 0,87000 & 0,40496 & 1,38568 & 0,76911 & -0,00430 & 0,51204 & 0,48604 & 0,00192 \\
585 & 0,707 & 0,295 & -0,002 & 0,81630 & 0,36475 & 1,58223 & 0,66019 & -0,00448 & 0,54467 & 0,45412 & 0,00121 \\
590 & 0,762 & 0,240 & -0,002 & 0,75700 & 0,32981 & 1,74901 & 0,55087 & -0,00459 & 0,57533 & 0,42413 & 0,00054 \\
595 & 0,809 & 0,193 & -0,001 & 0,69490 & 0,29995 & 1,87422 & 0,44712 & -0,00232 & 0,60249 & 0,39627 & 0,00124 \\
600 & 0,847 & 0,154 & -0,001 & 0,63100 & 0,27499 & 1,94353 & 0,35337 & -0,00229 & 0,62669 & 0,37256 & 0,00075 \\
605 & 0,880 & 0,121 & -0,001 & 0,56680 & 0,25402 & 1,96354 & 0,26999 & -0,00223 & 0,64823 & 0,35147 & 0,00030 \\
610 & 0,906 & 0,095 & -0,001 & 0,50300 & 0,23750 & 1,91879 & 0,20120 & -0,00212 & 0,66585 & 0,33420 & -0,00006\\
615 & 0,926 & 0,074 & -0,001 & 0,44120 & 0,22398 & 1,82404 & 0,14577 & -0,00197 & 0,68048 & 0,31988 & -0,00036\\
620 & 0,942 & 0,058 & 0,000 & 0,38100 & 0,21382 & 1,67849 & 0,10335 & 0,00000 & 0,69104 & 0,30812 & 0,00084 \\
625 & 0,955 & 0,045 & 0,000 & 0,32100 & 0,20556 & 1,49128 & 0,07027 & 0,00000 & 0,70052 & 0,29882 & 0,00065 \\
630 & 0,965 & 0,035 & 0,000 & 0,26500 & 0,19921 & 1,28370 & 0,04656 & 0,00000 & 0,70793 & 0,29156 & 0,00051 \\
635 & 0,973 & 0,027 & 0,000 & 0,21700 & 0,19413 & 1,08765 & 0,03018 & 0,00000 & 0,71393 & 0,28567 & 0,00040 \\
640 & 0,980 & 0,021 & 0,000 & 0,17500 & 0,19049 & 0,90031 & 0,01929 & 0,00000 & 0,71849 & 0,28120 & 0,00031 \\
645 & 0,985 & 0,015 & 0,000 & 0,13820 & 0,18650 & 0,72990 & 0,01112 & 0,00000 & 0,72305 & 0,27673 & 0,00022 \\
650 & 0,989 & 0,011 & 0,000 & 0,10700 & 0,18396 & 0,57525 & 0,00640 & 0,00000 & 0,72612 & 0,27371 & 0,00016 \\
655 & 0,992 & 0,008 & 0,000 & 0,08160 & 0,18205 & 0,44463 & 0,00359 & 0,00000 & 0,72844 & 0,27144 & 0,00012 \\
660 & 0,994 & 0,006 & 0,000 & 0,06100 & 0,18078 & 0,33540 & 0,00202 & 0,00000 & 0,72999 & 0,26992 & 0,00009 \\
665 & 0,995 & 0,005 & 0,000 & 0,04458 & 0,18015 & 0,24623 & 0,00124 & 0,00000 & 0,73077 & 0,26916 & 0,00007 \\
670 & 0,997 & 0,004 & 0,000 & 0,03200 & 0,17969 & 0,17755 & 0,00071 & 0,00000 & 0,73155 & 0,26839 & 0,00006 \\
675 & 0,997 & 0,003 & 0,000 & 0,02320 & 0,17888 & 0,12931 & 0,00039 & 0,00000 & 0,73232 & 0,26763 & 0,00004 \\
680 & 0,998 & 0,002 & 0,000 & 0,01700 & 0,17824 & 0,09519 & 0,00019 & 0,00000 & 0,73310 & 0,26687 & 0,00003 \\
685 & 0,999 & 0,001 & 0,000 & 0,01192 & 0,17761 & 0,06705 & 0,00007 & 0,00000 & 0,73388 & 0,26610 & 0,00001 \\
690 & 1,000 & 0,000 & 0,000 & 0,00821 & 0,17697 & 0,04639 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
695 & 1,000 & 0,000 & 0,000 & 0,00572 & 0,17697 & 0,03234 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
700 & 1,000 & 0,000 & 0,000 & 0,00410 & 0,17697 & 0,02318 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
705 & 1,000 & 0,000 & 0,000 & 0,00293 & 0,17697 & 0,01655 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
710 & 1,000 & 0,000 & 0,000 & 0,00209 & 0,17697 & 0,01182 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
715 & 1,000 & 0,000 & 0,000 & 0,00148 & 0,17697 & 0,00839 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
720 & 1,000 & 0,000 & 0,000 & 0,00105 & 0,17697 & 0,00592 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
725 & 1,000 & 0,000 & 0,000 & 0,00074 & 0,17697 & 0,00418 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
730 & 1,000 & 0,000 & 0,000 & 0,00052 & 0,17697 & 0,00294 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
735 & 1,000 & 0,000 & 0,000 & 0,00036 & 0,17697 & 0,00204 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
740 & 1,000 & 0,000 & 0,000 & 0,00025 & 0,17697 & 0,00141 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
745 & 1,000 & 0,000 & 0,000 & 0,00017 & 0,17697 & 0,00097 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
750 & 1,000 & 0,000 & 0,000 & 0,00012 & 0,17697 & 0,00068 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
755 & 1,000 & 0,000 & 0,000 & 0,00009 & 0,17697 & 0,00048 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
760 & 1,000 & 0,000 & 0,000 & 0,00006 & 0,17697 & 0,00034 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
765 & 1,000 & 0,000 & 0,000 & 0,00004 & 0,17697 & 0,00024 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
770 & 1,000 & 0,000 & 0,000 & 0,00003 & 0,17697 & 0,00017 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
775 & 1,000 & 0,000 & 0,000 & 0,00002 & 0,17697 & 0,00012 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
780 & 1,000 & 0,000 & 0,000 & 0,00002 & 0,17697 & 0,00008 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
785 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
790 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
795 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
800 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
805 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
810 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
815 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
820 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
825 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000 \\
830 & 1,000 & 0,000 & 0,000 & 0,00001 & 0,17697 & 0,00006 & 0,00000 & 0,00000 & 0,73467 & 0,26533 & 0,00000
\end{pmatrix}take almost 100ms for rendering. The output is larger than 64kB (it does not fit into the mathlog table). One of the most obvious reasons is that the numbers are handled as individual digits.
I created a small benchmarking script for LocalChecker: https://github.com/FrederikHennecke/mediawiki-extensions-Math-testing/tree/master/benchmarks
I used memcached for caching. The results show that the difference between a hit and a miss in the cache is relatively small. As for the input data, I used the reference.json file from the tests. Btw, this is my first time working with the cache, so take these results with a grain of salt.
benchAllMissCore........................I49 - Mo152.840ms (±1.30%) benchAllHitCore.........................I49 - Mo148.083ms (±2.42%)
I thought I did but I was mistaken. Seems like I forgot to set one specific cache value and the caching did not work. I fixed the benchmark and now the results are completely different:
benchAllMissCore........................I49 - Mo195.291ms (±2.60%) benchAllHitCore.........................I49 - Mo18.568ms (±4.47%)
Thank you. That seems to better match my expectations. I'll try to run your github on my machine to see if I can match those values. In https://ceur-ws.org/Vol-1785/W48.pdf we show the rendering time over the input length (Fig. 3). I find that a bit more intuitive (but more complicated) than the median.
I also added a test for that. You can see the result in the repo. We can see that the runtime for a HIT is roughly the same for the char length, and the runtime for a MISS does grow with input length.
@FrederikHennecke1 It's still significantly faster with caching. So we need to continue with caching.
I think we should start by using href on the elements instead of adding a. For Chrome, we can implement a polyfill.
I just tried to find all formulas in enwiki with QIDs with a short python script but I could only find 161 unique formulas. Is this correct? If that is the case I think that we don't necessarily have to rewrite the cache to cache these formulas. I also tested the performance of with / without caching and got the following results:
Miss: Native MML without links
count: 100000 rate: 1069.9/s total: 93466.28ms mean: 0.93ms max: 35.16ms stddev: 0.59ms
Hit: Native MML without links
count: 100000 rate: 6268.3/s total: 15953.29ms mean: 0.16ms max: 43.42ms stddev: 0.74ms
Miss: Native MML with formula links
count: 100000 rate: 467.3/s total: 213990.63ms mean: 2.14ms max: 77.15ms stddev: 1.69ms
Hit: Native MML with formula links
count: 100000 rate: 728.6/s total: 137240.21ms mean: 1.37ms max: 84.56ms stddev: 1.59ms
I only computed the formula $E=mc^2$ 100,000 times for this short benchmark.
For this change, we need to update ext.math.popup.js to make the Popup functionality work. I currently have a working prototype I'll upload in the next few days.
@FrederikHennecke1 the W3C mathwg discussion continued. Eventually, only mrow/a elements should have links. I suggest we add mrows when needed, and don't switch to a elements right now. As soon as Chrome has native support for links, we rename all mrow elements to a elements (which is a very minimal change with a lot of effect).
Change #1128019 abandoned by Physikerwelt:
[mediawiki/extensions/Math@master] Add support for more complex linking in <math/> formulas