Generally PSPP uses temporary files because it has a lot of data to
write to them. The default glibc buffer is only 4 kB. In my tests
using a 64 kB reduced runtime from 2.5 seconds to 2.0 seconds, but
increasing the buffer to 1 MB had no additional effect, so 64 kB is a
reasonable choice.
Bug #33260.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
file_name = xasprintf ("%s/%d", temp_dir->dir_name, idx++);
stream = fopen_temp (file_name, "wb+");
+ if (stream != NULL)
+ setvbuf (stream, NULL, _IOFBF, 65536);
free (file_name);
return stream;