in reply to Re^5: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
in thread Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)

You can, of course, push the problem to the client by using CSS and transparency in the browser. But it's far nicer to do the processing server-side. My experience with OpenGL and GLSL has been very positive so far and I found the GLSL to be relatively readable and quite concise in formulating the process that I wanted to happen, as soon as I had a mental model of how the calculation I wanted to be done could be modelled as a single pass over an array.

Maybe in the next 2 to 5 years, GPUs will become stock hardware, even without the graphics output, because they are incredibly suited to problems that can be formulated in an easily parallelizable way that reads from one or more memory sections and only write to one memory destination. But until then, you will be easier off by using the Inline::C version, especially in such one-off situations where it's likely that the bandwidth needed for uploading/downloading the image outweighs the performance gain of the (relatively simple) operation.

  • Comment on Re^6: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)

Replies are listed 'Best First'.
Re^7: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
by dragonchild (Archbishop) on Sep 13, 2007 at 15:18 UTC
    Pushing the problem out to CSS would be nice, but I'm working with thousands of calculations that are much easier to do server-side on strings of RGB triplets rather than client-side on full images. I ended up writing my own PNG outputer because I can do a huge amount of pre-processing because I'm controlling everything and can take advantage of specific optimizations. The browser can't do it because it has to deal with the general case. (Plus, IE's handling of PNG transparency isn't always correct.)

    I am looking forward to a time when GPUs will be more common. It would be interesting to see if CPUs could be replaced by GPUs for certain kinds of programming needs. I wonder if a gcc target could be a GPU ...


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?