File: performance.inc.rst

package info (click to toggle)
astropy 7.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 35,328 kB
  • sloc: python: 233,437; ansic: 55,264; javascript: 17,680; lex: 8,621; sh: 3,317; xml: 2,287; makefile: 191
file content (33 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.. note that if this is changed from the default approach of using an *include*
   (in index.rst) to a separate performance page, the header needs to be changed
   from === to ***, the filename extension needs to be changed from .inc.rst to
   .rst, and a link needs to be added in the subpackage toctree

.. _astropy-io-ascii-performance:

Performance Tips
================

By default, when trying to read a file the reader will guess the format, which
involves trying to read it with many different readers. For better performance
when dealing with large tables, it is recommended to specify the format and any
options explicitly, and turn off guessing as well.

Example
-------

..
  EXAMPLE START
  Performance Tips for Reading Large Tables with astropy.io.ascii

If you are reading a simple CSV file with a one-line header with column names,
the following::

    read('example.csv', format='basic', delimiter=',', guess=False)  # doctest: +SKIP

can be at least an order of magnitude faster than::

    read('example.csv')  # doctest: +SKIP

..
  EXAMPLE END