Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(math): output as SVG instead of CHTML #4196

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

CCXXXI
Copy link
Contributor

@CCXXXI CCXXXI commented Aug 10, 2022

审核的同学 请着重关注以下四方面:

  1. 注意有没有 typo
  2. 不论您是否熟悉相关知识,都请以初学者的角度把这个 PR 的内容阅读一遍,跟着作者的思路走,然后谈谈您的感受
  3. 如果您熟悉相关知识,请按照自己的理解评估这个 PR 的内容是否合适
  4. 尽量保持跟进直到它被 merge 或 close

@shuzhouliu shuzhouliu added javascript Pull requests that update Javascript code Other Bug / 内容无关的 Bug 内容无关的 bug labels Aug 10, 2022
@CoelacanthusHex
Copy link
Member

之前更新 MathJax 的时候讨论过输出后端,SVG 的体积实在太太太太太大了

@CCXXXI
Copy link
Contributor Author

CCXXXI commented Aug 10, 2022

之前更新 MathJax 的时候讨论过输出后端,SVG 的体积实在太太太太太大了

测了下发现从 115 MB 上升到 173 MB,差别好像也不是特别大?

@Menci
Copy link
Member

Menci commented Aug 10, 2022

不推荐用 SVG,页面太大了

@CCXXXI
Copy link
Contributor Author

CCXXXI commented Aug 10, 2022

那就只能希望 #4193 能以其他方式修好了

@CCXXXI CCXXXI closed this Aug 10, 2022
@CCXXXI CCXXXI deleted the fix/4193 branch August 10, 2022 09:59
@CCXXXI
Copy link
Contributor Author

CCXXXI commented Aug 10, 2022

另外 SVG 大小可以被压缩 25%±5%,虽然要说大的话也还是很大

@CCXXXI CCXXXI restored the fix/4193 branch August 10, 2022 12:02
@CCXXXI
Copy link
Contributor Author

CCXXXI commented Aug 10, 2022

CHTML 与 SVG 性能测试:

CHTML

image
image
image

SVG

image
image
image

  • 测试页面为 /math/complex/,包含较多公式
  • 测试工具为 Chrome Lighthouse
  • 确实会变慢,但不借助统计工具应该很难注意到这么点差异

@Menci
Copy link
Member

Menci commented Aug 10, 2022

@CCXXXI 测一下渲染速度?

@CCXXXI
Copy link
Contributor Author

CCXXXI commented Aug 10, 2022

svg 似乎反而更快一点(可能是误差)

WebPageTest
Check out these web performance test results on WebPageTest.org:
WebPageTest
Check out these web performance test results on WebPageTest.org:

@shuzhouliu
Copy link
Member

这不页面加载时间吗

@CCXXXI
Copy link
Contributor Author

CCXXXI commented Aug 10, 2022

这不页面加载时间吗

指哪些数据

@CCXXXI
Copy link
Contributor Author

CCXXXI commented Aug 10, 2022

另外测试的具体内容分别是:

GitHub
🌟 Wiki of OI / ICPC for everyone. (某大型游戏线上攻略,内含炫酷算术魔法) - GitHub - CCXXXI/OI-wiki at 1050d88
GitHub
🌟 Wiki of OI / ICPC for everyone. (某大型游戏线上攻略,内含炫酷算术魔法) - GitHub - CCXXXI/OI-wiki at 20d2a8d

@shuzhouliu
Copy link
Member

image

image

@CCXXXI
Copy link
Contributor Author

CCXXXI commented Aug 11, 2022

搬运部分群内相关讨论:

image
MJ处理公式SVG会比CHTML快
https://t.me/c/1344172945/141384

要不要对指定的一些公式用 SVG
https://t.me/c/1344172945/141385

Telegram
Telegram

@Great-designer

This comment was marked as spam.

@Great-designer

This comment was marked as spam.

@CoelacanthusHex
Copy link
Member

之前更新 MathJax 的时候讨论过输出后端,SVG 的体积实在太太太太太大了

测了下发现从 115 MB 上升到 173 MB,差别好像也不是特别大?

150%,这个差距已经非常大了

@CCXXXI
Copy link
Contributor Author

CCXXXI commented Jan 9, 2023

之前更新 MathJax 的时候讨论过输出后端,SVG 的体积实在太太太太太大了

测了下发现从 115 MB 上升到 173 MB,差别好像也不是特别大?

150%,这个差距已经非常大了

平摊到每个页面并不大,根据上面的测试,页面打开速度没有明显下降

yanboishere
yanboishere previously approved these changes Jan 18, 2023
@alphagocc
Copy link
Contributor

Chrome 109 已经支持 MathML,未来切换到 MathML 是可行的吗

@CCXXXI
Copy link
Contributor Author

CCXXXI commented May 27, 2023

这个 PR 最初想解决的 #4193 已经被修好了,需要留着作为 #4584 和 CHTML 可能导致的其他问题的一种解决方案吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Discussion / 需要讨论 Further discussion is welcome javascript Pull requests that update Javascript code Need Processing / 需要处理 Other Bug / 内容无关的 Bug 内容无关的 bug 中优先级 / P2 Pending review / 等待审核 RFC / 提案
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Mathjax 渲染得过于紧凑 [BUG] overline 在某些缩放下消失
9 participants