Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: BENCHMARK Re: number of unique characters in a string

by BrowserUk (Patriarch)
on Mar 01, 2003 at 20:08 UTC ( [id://239750]=note: print w/replies, xml ) Need Help??


in reply to BENCHMARK Re: number of unique characters in a string
in thread number of unique characters in a string

I expected 5x or maybe 10x faster for the C version but 22...

One thing to note. The original version of nUniqC() that uses the local array is quicker than the one (re)-using @_ despite my claims for the latter. Turned out it was an artifact of my own testing that gave me false readings. Not that it is going to get even close to merlyn's.

It's good to get a feel for the difference, and will make me renew my efforts to build my own version of Perl so that I will have that facility available to me.


Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.
  • Comment on Re: BENCHMARK Re: number of unique characters in a string

Replies are listed 'Best First'.
Re: Re: BENCHMARK Re: number of unique characters in a string
by Jenda (Abbot) on Mar 01, 2003 at 20:47 UTC

    I should have tried that. I did change one of mine from using a lexical array to @_ and noticed a slowdown, but did not think about trying to modify nUniqC().

    Shame Inline::C doesn't play well with PerlApp (yet?). I could use it as an "inline assebler" as I once did in Pascal if this worked. (Is there anyone who did not design and implement his/her own menu&window system for DOS/character terminal? :)

    Actually ... does Inline::C work with PAR? I mean does PAR take the compiled C code and include the compiled library in the archive?

    Jenda

      No idea on the PerlApp/PAR question as I have never had the need for them (yet).

      As for the DOS Ansi "windowing system", I once wrote a twin threaded version in REXX (under OS/2) called AnsiPM. I think that it even made it onto the IBM internal tools repository, though by then it had been handed over to someone else to maintain. Fun days.


      Examine what is said, not who speaks.
      1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
      2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
      3) Any sufficiently advanced technology is indistinguishable from magic.
      Arthur C. Clarke.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found