ArthurHub / ArthurHub/HTML-Renderer

Super slow performance when there are lots of "a" html tags

未关闭
#239 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug HTML
主要语言
C#
星标
1.4k
派生
550
平均合并
14 天 9 小时
30 天内合并 PR
1

描述

I am displaying an HTML, having about 200 **a** tags, the initial load and display of html is super slow.

When I modify **IsBlockAssignableToBox** function, so it does not add **a** tags, the performance issue is resolved ( and offcourse a tags are not rendered as links)

modifed **IsBlockAssignableToBox** version :

```
private static bool IsBlockAssignableToBox(CssBox box, CssBlock block)
{
bool assignable = true;
if (block.Selectors != null)
{
assignable = IsBlockAssignableToBoxWithSelector(box, block);
}
else if (box.HtmlTag.Name.Equals("a", StringComparison.OrdinalIgnoreCase) && block.Class.Equals("a", StringComparison.OrdinalIgnoreCase)
// && !box.HtmlTag.HasAttribute("href")
)
{
assignable = false;
}

if (assignable && block.Hover)
{
box.HtmlContainer.AddHoverBox(box, block);
assignable = false;
}

return assignable;
}
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by profiling the IsBlockAssignableToBox function while loading an HTML document with about 200 a tags, then compare the normal path with the reported modification. Done means the document renders links without the severe initial-load slowdown; the issue does not name a test or source file beyond this function.

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, html
领域
frontend, performance
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。