SD cards can have occasional write delays of up to 200 milliseconds. This due to erasing large flash blocks and remapping bad spots.
These delays can cause data points to be lost at rates over a few points per second.
A real-time kernel can be used to solve this problem. Data is captured in a high priority task and queued for a lower priority task to write to an SD card.
I have posted several sketches for faster data logging using special tricks but a real-time kernel is a more general way to solve this type problem.
I have ported two real-time kernels to the Arduino, FreeRTOS and ChibiOS/RT, and developed fast data logging sketches that use these kernels. The kernels are easy to use Arduino libraries so no modification of the core Arduino files or IDE is required.
The examples are here http://code.google.com/p/beta-lib/downloads/list
in files ChibiOS20111027.zip and FreeRTOS20111031.zip.
On a 328 Arduino it is possible to log up to 976 points per second (one point every 1024 microseconds) to an CSV file where each point is the value from two analog pins.
On a Mega, with more buffering, values from four analog pins can be logged at the above rate to a CSV file.
More about the ChibiOS/RT port is here http://arduino.cc/forum/index.php/topic,76932.0.html
The FreeRTOS port is described here http://arduino.cc/forum/index.php/topic,77362.0.html