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

Performance improvements for /lastlog #715

Merged
merged 2 commits into from Jun 6, 2017

Conversation

Projects
None yet
2 participants
@dequis
Copy link
Member

commented Jun 5, 2017

  • Performance improvements for /lastlog with big result sets

    This applies to "/lastlog" with no filters (or with filters that don't
    filter a lot) and with large amounts of text in the scrollback.

    Test case:

      /exec seq 1 500000
      /lastlog -file log.txt
    

    Thanks to morning for reporting this.

  • Performance improvements for /lastlog -before

    This avoids the use of g_list_find() to find if a match was already
    added to the list of results, by checking the last two added matches
    instead.

    Checking just the last match isn't enough because a NULL match is added
    as a separator (shown as -- in the UI)


Test materials I used:

To test -before i used this in my ~/.irssi/startup

echo 1
echo 2
echo 3ASD
echo 4
echo 5
echo 6ASD
echo 7
echo 8ASD
echo 9ASD
echo 10
echo 11
echo 12
echo 13ASD
echo 14
echo 15
echo 16
echo 17
echo 18ASD
echo 19
echo 20
echo 21
echo 22
echo 23
echo 24ASD

Then /lastlog -clear -before 2 ASD, with different values of before.

To understand how -before works I used this gdb script (line numbers for master before this change), using the glib python gdb integration module for gforeach.

break textbuffer.c:610
commands
p "matched?"
p line_matched
p "text"
p line->text
p "matches so far"
gforeach i in matches: p $i ? ((LINE_REC *) $i)->text : 0
end

break textbuffer.c:613
commands
p "searching"
p pre_line->prev->text
p "matches so far"
gforeach i in matches: p $i ? ((LINE_REC *) $i)->text : 0
end

This needs /set theme colorless to read the text of LINE_REC directly.

dequis added some commits Jun 5, 2017

Performance improvements for /lastlog with big result sets
This applies to "/lastlog" with no filters (or with filters that don't
filter a lot) and with large amounts of text in the scrollback.

Test case:

    /exec seq 1 500000
    /lastlog -file log.txt

Thanks to morning for reporting this.
Performance improvements for /lastlog -before
This avoids the use of g_list_find() to find if a match was already
added to the list of results, by checking the last two added matches
instead.

Checking just the last match isn't enough because a NULL match is added
as a separator (shown as -- in the UI)

@ailin-nemui ailin-nemui merged commit 3246001 into irssi:master Jun 6, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.