Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: How fast is fast?

by Logicus (Initiate)
on Aug 08, 2011 at 17:05 UTC ( [id://919283]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How fast is fast?
in thread How fast is fast?

We used to draw polygons line by line using fixed point maths to avoid the overhead of using floating point maths, prior to the advent of the maths co-processor or FPU.

These days we direct powerful GPU hardware to draw them for us. There is no way that the algorithms used today could possibly run properly on machines with no GPU, regardless of how well you optimise them. They are far too complex and involve far too much data manipulation.

The same hardware which accelerates graphics rendering is also usable for regex's. And suddenly with that additional piece of hardware being used, regex's are no longer the slow/stupid way of doing things, but infact the smart way of doing things because you have like 512 processors and several gigs of high-speed ram on your side running those regex's at lightening speed behind the scenes.

The more of that work you can shift away from the CPU, the better!

Ps. is it regexes, regex's or regexen? I dunno...

P.P.s I really hope Perl6 will be the first language to fully exploit that fact!

Replies are listed 'Best First'.
Re^5: How fast is fast?
by BrowserUk (Patriarch) on Aug 08, 2011 at 18:12 UTC
    The same hardware which accelerates graphics rendering is also usable for regex's.

    This is the first thing I've seen you say that has any technical merit. Embarrassingly parallel gpus definitely could be used to accelerate regex. But there are (at least) three problems with you relying on that to try and make your obscure, messy and frankly, mundane "invention" a viable proposition:

    • To my knowledge -- and I try hard to keep abreast of such developments -- no one has yet coded a regex engine to make use of gpu acceleration.

      And let's face it. It isn't going to be you that does it.

      So you may have a long wait, because of the following reasons.

    • Gpu algorithms run very quickly, but they have to be linear.

      That is, there is considerable overhead in setting up a run. Moving the required data into the gpu and loading its registers with the programs. In order to be effective, the setup costs have to be amortised over runs against large volumes of data that can be processed without decision points.

      Regex aren't like that. They are usually run on relatively small volumes of data -- a few kb of string at most -- and to do much of anything useful, they have to be able to backtrack. And each time they have to back track, you have to reset to the cpu and set up the gpu anew.

      In other words, for the type of processing your toy needs, a gpu accelerated regex engine would be started & stopped so frequently, there would be little if any gain from using it over an efficient single-threaded, iterative cpu implementation.

    • If a regex engine can be coded to use a gpu effectively, a chart parser (like Earley) could also be so coded.

      And as chart parsers are inherently more efficient -- single pass -- than your cobbled-together, many backtracking regex passes, the former will still beat your implementation hands down.

    Your regex implementation can be improved markedly. Indeed I'd achieved an order of magnitude improvement before you pissed me off so badly that I threw it in the bit-bucket and told you where to get off. But that it the least of your troubles.

    The real problem is that you have yet to make any kind of a real case for your "invention", and the cases you have are so full of "believe me"'s and "I know"s and a total lack of any empirical demonstration, that there is simply no basis on which anyone still sympathetic to your cause (are there any?), can justify the expenditure of any effort to pursue it. You just have not made (nor even attempted to make) a solid case for your "invention".

    What would such a case consist of? How about a web shop selling say 100 products (just prod001 -- prod100) that each have a different price (say £1 .. £100; it doesn't have to be realistic), and the user can browse the site, purchase some number of each of several products and you produce a summary screen and total. Post the templates (or whatever you wish to call them), along with the code required to run the site.

    Anti up a realistic demonstration of what your "invention" is capable of, and someone might see some merit in it. Continue to complain that we are all too dumb to perceive your brilliance and no one will.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      BrowserUk,

      What would such a case consist of? How about a web shop selling say 100 products (just prod001 -- prod100) that each have a different price (say £1 .. £100; it doesn't have to be realistic), and the user can browse the site, purchase some number of each of several products and you produce a summary screen and total. Post the templates (or whatever you wish to call them), along with the code required to run the site.

      Anti up a realistic demonstration of what your "invention" is capable of, and someone might see some merit in it. Continue to complain that we are all too dumb to perceive your brilliance and no one will.

      I said pretty much the same thing here and am still waiting for some reason to get excited.

      Cheers - L~R

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-20 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found