Hi.

I'd like to create a program to handle data (natural numbers)
within a 450,000 x 450,000 array. I'm considering PHP, but
I don't know is it's powerful enough to manage it.

Thank you very much.

    First you need to know how big that array will be. The array will be around 800 GB if each number is a 4 byte integer. I would like to say that handling this kind of data is not anything for a normal computer, it does not matter what platform or program language you use.

    But do you really need it as an array? You can probably do it with a database, and it will be a lot faster. It may still be very slow, and you still need lots of storing space, but I think it is a better idea.

      Hi.

      Thank you very much for your quick answers. I try to handle data from a
      450x450 meter surface.

      I've got 100,000 elements distributed on this surface, and each
      square millimeter can hold one or more elements. So the array to create
      is a sparse one: most of square millimeters holds zero elements, and
      the rest, 20 or less.

      I'm trying to find the square meter with more elements inside.

      Thank you very much.

        Perhaps you do not need an array of the surface, but rather include attributes for each object with their current x/y coordinates? (And if this is done in a database, then you have the built in ability to sort elements by those coordinates to facilitate map rendering and such.)

          Because of the overhead of PHP, it is unlikely to be feasible to handle a 450,000 x 450,000 array natively.

          If you really need to do this, consider using C++ instead. I am assuming that your system has enough RAM to do it (and probably 64-bit might be a good idea so you don't run short of address space).

          Otherwise, consider an alternative approach.

          PHP is generally a poor choice for high performance scientific computing due to its poor performance, weak typing system etc.

          Mark

            Write a Reply...