mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
Terminal: Make sure empty hrefs set a null string on Attribute
Else, we store an empty but allocated string for each Attribute after a href was emitted (since it's ended by a non-null empty string), which makes Line objects very expensive to destroy and to modify. Reduces `disasm /bin/id` from 414ms to 380ms (min-of-5). There's a lot more perf wins to be had with better href handling (most lines don't have any hrefs, so instead of storing a string per Attr, maybe we could have a vector of hrefs per line and int offsets into that in each Attr for example), but this is a simple, obvious, and effective improvement, so let's start with this.
This commit is contained in:
parent
063fb02ef4
commit
a6734766ec
Notes:
sideshowbarker
2024-07-19 02:42:50 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/a6734766ecf Pull-request: https://github.com/SerenityOS/serenity/pull/3472
1 changed files with 8 additions and 3 deletions
|
@ -576,9 +576,14 @@ void Terminal::execute_xterm_command()
|
|||
m_client.set_window_title(params[1]);
|
||||
break;
|
||||
case 8:
|
||||
m_current_attribute.href = params[2];
|
||||
// FIXME: Respect the provided ID
|
||||
m_current_attribute.href_id = String::format("%u", m_next_href_id++);
|
||||
if (params[2].is_empty()) {
|
||||
m_current_attribute.href = String();
|
||||
m_current_attribute.href_id = String();
|
||||
} else {
|
||||
m_current_attribute.href = params[2];
|
||||
// FIXME: Respect the provided ID
|
||||
m_current_attribute.href_id = String::format("%u", m_next_href_id++);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
m_client.set_window_progress(numeric_params[1], numeric_params[2]);
|
||||
|
|
Loading…
Reference in a new issue