02:30 pm
Firefox на одноядерном Селероне тормозит,
говорят, это из-за многочисленных sync(),
особенно при переключении вкладок.
sync надо отключить.
Решение такое:
http://ftp.die.net/pub/qmail-tools/libnosync.c (см. ниже)
В файл /usr/bin/firefox (скрипт)
добавить в начале:
if [ "$LD_PRELOAD" ] ; then
LD_PRELOAD=$LD_PRELOAD:/usr/lib/libnosync.so
else
LD_PRELOAD=/usr/lib/libnosync.so
fi
/*
** libnosync.so -- library to disable sync/fsync/fdatasync
** Copyright (c)2002 Aaron Hopkins <tools@die.net>
** All Rights Reserved.
**
** This can be used to speed SMTP servers up greatly on mailservers where data
** integrity in the face of system crashes is unnecessary while speed is.
**
** 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
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Compile with:
** gcc -O2 -s -Wall -fPIC -shared -o libnosync.so libnosync.c
**
** With bash: export LD_PRELOAD=/path/to/libnosync.so
**
** With tcsh: setenv LD_PRELOAD /path/to/libnosync.so
**
*/
#include <unistd.h>
void
sync (void) {
}
int
fsync (int fd) {
return 0;
}
int
fdatasync (int fd) {
return 0;
}