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;
}
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

先在載入包含約 200 個 a 標籤的 HTML 文件時,對 IsBlockAssignableToBox 函式進行效能分析,然後將正常路徑與回報的修改進行比較。完成的標準是:文件能夠轉譯連結,且初始載入不會出現嚴重變慢;該 issue 除了此函式之外,沒有指定測試檔案或原始碼檔案。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, html
領域
frontend, performance
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。