Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: performance of length() in utf-8

by kennethk (Abbot)
on Mar 03, 2016 at 20:38 UTC ( [id://1156763]=note: print w/replies, xml ) Need Help??


in reply to Re: performance of length() in utf-8
in thread performance of length() in utf-8

Your LenTestA is exponential
That would be quadratic growth. You have a series of operations that grows linearly, and your number of invocations grows linearly with line length.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^3: performance of length() in utf-8
by Anonymous Monk on Mar 03, 2016 at 20:46 UTC
    Maybe, maybe, I don't speak english very well. Basically, it's O(N**2).
      Yes, quadratic is a synonym for polynomial of second order.

      Quadratic_growth

      Exponential_growth -- also known as explosive or geometric growth


      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      For reference, exponential would be similar to O(2**N), which is terrible like the traveling spambot problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1156763]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-26 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found