Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] can QString::contains() be fast?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] can QString::contains() be fast?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yanbellavance
    wrote on last edited by
    #1

    I am looking for a keyword in a long string by using the contains() function. The keyword is at the beginning (not exactly but close). Will it be as fast or almost as fast as if I was searching in a small string?

    ex: "1 or 2 words I AM LOOKING FOR THIS more words maybe 200 or so"

    1 Reply Last reply
    0
    • B Offline
      B Offline
      baysmith
      wrote on last edited by
      #2

      According to the implementation:

      bq. We use the Boyer-Moore algorithm in cases where the overhead for the skip table should pay off, otherwise we use a simple hash function.

      The Boyer-Moore algorithm is used if string length is greater than 500 and the search string length is greater than 5.

      Nokia Certified Qt Specialist.

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yanbellavance
        wrote on last edited by
        #3

        thanks! That's what I needed to know.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved