Performance issue with DataFrame.to_csv()
I have a performance issue that I discovered by noticing that 173 MB sized CSV files take quite a while to write out (I have to write many of them). The io profiler I use is `iotop` that indicated that my write rate was a meager 9 MB/s while the raid I am writing to supports up to 20 times that, as I have confirmed with a pure `open(fname,'w').write(longstring)`.

Here's info on the dataframe:

``` python
In [17]: df.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 590604 entries, 0 to 590603
Data columns (total 36 columns):
jdate        590604 non-null float64
orbit        590604 non-null int64
sundist      590604 non-null float64
sunlat       590604 non-null float64
sunlon       590604 non-null float64
sclk         590604 non-null float64
sclat        590604 non-null float64
sclon        590604 non-null float64
scrad        590604 non-null float64
scalt        590604 non-null float64
el_cmd       590604 non-null float64
az_cmd       590604 non-null float64
af           590604 non-null float64
orientlat    590604 non-null float64
orientlon    590604 non-null float64
det          590604 non-null int64
vlookx       590604 non-null float64
vlooky       590604 non-null float64
qge          590604 non-null float64
clat         183036 non-null float64
csunzen      183036 non-null float64
qca          590604 non-null float64
vlookz       590604 non-null float64
clon         183036 non-null float64
cloctime     183036 non-null float64
csunazi      183036 non-null float64
cemis        183036 non-null float64
tb           590604 non-null float64
radiance     590604 non-null float64
hour         590604 non-null int64
minute       590604 non-null int64
second       590604 non-null float64
year         590604 non-null int64
month        590604 non-null int64
date         590604 non-null int64
c            590604 non-null int64
dtypes: float64(28), int64(8)
```

and here's the output of a profiling run:

``` bash
In [16]: %prun df.to_csv()
         2969486 function calls in 19.916 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      213   16.523    0.078   18.138    0.085 {pandas.lib.write_csv_rows}
   590605    1.101    0.000    1.616    0.000 StringIO.py:208(write)
      427    0.980    0.002    0.980    0.002 {pandas.lib.isnullobj}
   593811    0.279    0.000    0.284    0.000 {isinstance}
      854    0.221    0.000    0.221    0.000 {numpy.core.multiarray.array}
      640    0.180    0.000    0.180    0.000 {method 'tolist' of 'numpy.ndarray' objects}
      213    0.168    0.001   19.784    0.093 format.py:1283(_save_chunk)
   590606    0.084    0.000    0.084    0.000 StringIO.py:38(_complain_ifclosed)
   590605    0.082    0.000    0.082    0.000 {method 'append' of 'list' objects}
        1    0.082    0.082    0.082    0.082 {method 'join' of 'str' objects}
   590821    0.074    0.000    0.074    0.000 {len}
      213    0.048    0.000    1.198    0.006 internals.py:1041(to_native_types)
        1    0.043    0.043    0.124    0.124 StringIO.py:258(getvalue)
      640    0.013    0.000    1.001    0.002 common.py:202(_isnull_ndarraylike)
      213    0.009    0.000    0.250    0.001 internals.py:420(to_native_types)
        1    0.004    0.004   19.788   19.788 format.py:1265(_save)
     2134    0.004    0.000    0.005    0.000 {getattr}
      640    0.003    0.000    1.011    0.002 common.py:132(_isnull_new)
        1    0.002    0.002   19.916   19.916 decorators.py:47(wrapper)
      214    0.002    0.000    0.023    0.000 index.py:821(_format_native_types)
      213    0.002    0.000    0.004    0.000 index.py:694(__getitem__)
      853    0.002    0.000    0.003    0.000 numeric.py:1810(isscalar)
      214    0.002    0.000    0.029    0.000 index.py:814(to_native_types)
     1280    0.002    0.000    0.004    0.000 common.py:58(_check)
      427    0.002    0.000    0.002    0.000 {numpy.core.multiarray.empty}
      640    0.001    0.000    0.004    0.000 {pandas.lib.isscalar}
      427    0.001    0.000    0.001    0.000 {method 'reshape' of 'numpy.ndarray' objects}
      213    0.001    0.000    0.001    0.000 index.py:245(__array_finalize__)
      640    0.000    0.000    1.012    0.002 common.py:111(isnull)
        1    0.000    0.000   19.916   19.916 <string>:1(<module>)
      427    0.000    0.000    0.000    0.000 {method 'ravel' of 'numpy.ndarray' objects}
      213    0.000    0.000    0.000    0.000 index.py:207(_reset_identity)
      426    0.000    0.000    0.000    0.000 internals.py:93(mgr_locs)
      214    0.000    0.000    0.001    0.000 numeric.py:392(asarray)
      213    0.000    0.000    0.000    0.000 {min}
      214    0.000    0.000    0.001    0.000 index.py:432(values)
        1    0.000    0.000    0.000    0.000 format.py:948(__init__)
        1    0.000    0.000   19.913   19.913 frame.py:1069(to_csv)
        1    0.000    0.000   19.788   19.788 format.py:1149(save)
        1    0.000    0.000    0.000    0.000 format.py:1187(_save_header)
        1    0.000    0.000    0.000    0.000 {method 'writerow' of '_csv.writer' objects}
        3    0.000    0.000    0.000    0.000 format.py:1027(<genexpr>)
        1    0.000    0.000    0.000    0.000 {_csv.writer}
        1    0.000    0.000    0.000    0.000 StringIO.py:54(__init__)
        1    0.000    0.000    0.000    0.000 {sum}
        2    0.000    0.000    0.000    0.000 internals.py:171(shape)
        1    0.000    0.000    0.000    0.000 {hasattr}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        1    0.000    0.000    0.000    0.000 {method 'get' of 'dict' objects}
        1    0.000    0.000    0.000    0.000 index.py:345(nlevels)
        1    0.000    0.000    0.000    0.000 {method 'pop' of 'dict' objects}
```

Note that above time of about 20 seconds is only the conversion to a string, which seems to be the longest part.
For completeness, here's the profile when writing the file:

``` bash
In [19]: %prun df.to_csv('/raid1/maye/rdr_out/test_write_speed.csv')
         16458 function calls in 18.126 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      213   16.447    0.077   16.447    0.077 {pandas.lib.write_csv_rows}
      427    0.979    0.002    0.979    0.002 {pandas.lib.isnullobj}
      854    0.182    0.000    0.182    0.000 {numpy.core.multiarray.array}
      213    0.167    0.001   18.029    0.085 format.py:1283(_save_chunk)
      640    0.159    0.000    0.159    0.000 {method 'tolist' of 'numpy.ndarray' objects}
        1    0.059    0.059    0.059    0.059 {method 'close' of 'file' objects}
      213    0.048    0.000    1.137    0.005 internals.py:1041(to_native_types)
        1    0.032    0.032    0.032    0.032 {open}
      640    0.013    0.000    1.000    0.002 common.py:202(_isnull_ndarraylike)
      213    0.009    0.000    0.249    0.001 internals.py:420(to_native_types)
        1    0.004    0.004   18.033   18.033 format.py:1265(_save)
     3205    0.004    0.000    0.008    0.000 {isinstance}
     2134    0.004    0.000    0.005    0.000 {getattr}
      640    0.003    0.000    1.009    0.002 common.py:132(_isnull_new)
      214    0.002    0.000    0.023    0.000 index.py:821(_format_native_types)
      213    0.002    0.000    0.004    0.000 index.py:694(__getitem__)
      214    0.002    0.000    0.029    0.000 index.py:814(to_native_types)
      853    0.002    0.000    0.003    0.000 numeric.py:1810(isscalar)
     1280    0.002    0.000    0.004    0.000 common.py:58(_check)
      427    0.001    0.000    0.001    0.000 {numpy.core.multiarray.empty}
      640    0.001    0.000    0.003    0.000 {pandas.lib.isscalar}
      427    0.001    0.000    0.001    0.000 {method 'reshape' of 'numpy.ndarray' objects}
        1    0.001    0.001   18.126   18.126 decorators.py:47(wrapper)
      213    0.001    0.000    0.001    0.000 index.py:245(__array_finalize__)
      640    0.000    0.000    1.009    0.002 common.py:111(isnull)
      427    0.000    0.000    0.000    0.000 {method 'ravel' of 'numpy.ndarray' objects}
      213    0.000    0.000    0.000    0.000 index.py:207(_reset_identity)
      426    0.000    0.000    0.000    0.000 internals.py:93(mgr_locs)
      214    0.000    0.000    0.001    0.000 numeric.py:392(asarray)
      213    0.000    0.000    0.000    0.000 {min}
      214    0.000    0.000    0.001    0.000 index.py:432(values)
      215    0.000    0.000    0.000    0.000 {len}
        1    0.000    0.000   18.125   18.125 format.py:1149(save)
        1    0.000    0.000    0.000    0.000 format.py:948(__init__)
        1    0.000    0.000   18.125   18.125 frame.py:1069(to_csv)
        1    0.000    0.000    0.000    0.000 {method 'writerow' of '_csv.writer' objects}
        1    0.000    0.000    0.000    0.000 format.py:1187(_save_header)
        1    0.000    0.000    0.000    0.000 {_csv.writer}
        3    0.000    0.000    0.000    0.000 format.py:1027(<genexpr>)
        1    0.000    0.000   18.126   18.126 <string>:1(<module>)
        1    0.000    0.000    0.032    0.032 common.py:2336(_get_handle)
        1    0.000    0.000    0.000    0.000 {sum}
        2    0.000    0.000    0.000    0.000 internals.py:171(shape)
        1    0.000    0.000    0.000    0.000 {hasattr}
        1    0.000    0.000    0.000    0.000 index.py:345(nlevels)
        1    0.000    0.000    0.000    0.000 {method 'pop' of 'dict' objects}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        1    0.000    0.000    0.000    0.000 {method 'get' of 'dict' objects}
```

Pandas version: ['0.13.1-769-gf26cf9e'](f26cf9e) , running on a 64-bit CentOS6.
