Skip to content

NMP "looks intentional" error (marking FP) #286

Closed

Description

@yakra

Allow nmpfps.log lines ending in [LOOKS INTENTIONAL] to be processed.

Activity

  1. self-assigned this
    on Mar 23, 2020
  2. yakra commented on Mar 24, 2020

    @yakra
    ContributorAuthor

    fix #150 first

  3. yakra commented on Mar 26, 2020

    @yakra
    ContributorAuthor

    C++:

    • Before: 0.7s.
    • After: 3.5s. A 5x increase doesn't seem to make sense, as iterating thru the FP list and checking for matches gets tripled:
      • entry
      • entry + " [LOOKS INTENTIONAL]"
      • entry + " [SOME LOOK INTENTIONAL]"
      The entries that are FPs aren't even tripled, as we only have to search part of the list, or not all three.
      And that's the only change. It's not even everything we do in this function. But anyway...
    • Changing the FP entry container from a list to a set, we get 0.6s. Whether we search for only the original string or all three variants. A performance penalty-free enhancement? I'll take it!

    Python:

    • ToDo
  4. yakra commented on Mar 27, 2020

    @yakra
    ContributorAuthor

    Python:

    • Before: 0.9s.
    • Accept all 3 variants, still using a list: 1.1s. Man. There's something about testing list membership, under the hood, that makes Python fast (...or C++ slow).
    • set(), checking only for raw entry: 0.8s
    • set(), checking for all 3 variants: 0.85s.
  5. yakra commented on Mar 27, 2020

    @yakra
    ContributorAuthor

    There's something about testing list membership, under the hood, that makes Python fast (...or C++ slow).

    Python lists aren't really "lists" as we know them, but more comparable to a vector in C++.
    A doubly-linked list probably has a bit more overhead when iterating, adding up to yield our time difference.
    Be interesting to try an approach using std::vector and seeing how performance compares.
    Edit: 3.625s. Moderately slower or within margin of error. Hm. C++ Y U so slow!

    On the Python side, still using lists instead of sets, we can speed up the process by using try, index, except, and pop to avoid searching for the string again on removal (see #289).
    Will it be faster than using a set? Probably not?
    Edit: 0.925s searching for 1 string; 1.05s searching for up to 3. Within margin of error.


    So I remember what I'm doing with various revisions of the code...

    "nmpli"
    version
    description
    2 initial fix for #150 ("Before" above)
    3 an attempt to change nmp merged files before realizing it was a bad idea
    4 search all 3 strings, still using list
    5 set, checking only raw entry
    6 search all 3 strings, using set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions