ArthurHub / ArthurHub/HTML-Renderer
Super slow performance when there are lots of "a" html tags
- Vorherrschende Sprache
- C#
- Sterne
- 1.4k
- Forks
- 550
- Ø Merge
- 14 T. 9 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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;
}
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, html
- Bereich
- frontend, performance
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100