summaryrefslogtreecommitdiff
path: root/lib/fsm.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-12-06 18:34:49 +0000
committerjbj <devnull@localhost>2001-12-06 18:34:49 +0000
commit5a0508d51fcf84412a8f6a88a09d6dd63a16e47e (patch)
treecf3782de354fb3b37295f75f465c7574110fdb52 /lib/fsm.c
parentd7e49147a28f795312b330cbfe68e60798212a93 (diff)
downloadlibrpm-tizen-5a0508d51fcf84412a8f6a88a09d6dd63a16e47e.tar.gz
librpm-tizen-5a0508d51fcf84412a8f6a88a09d6dd63a16e47e.tar.bz2
librpm-tizen-5a0508d51fcf84412a8f6a88a09d6dd63a16e47e.zip
- 3 madvise calls and a 16Mb mmapped buffer == ~5% install speedup. Wow.
- use db-4.0.14 final internally. CVS patchset: 5215 CVS date: 2001/12/06 18:34:49
Diffstat (limited to 'lib/fsm.c')
-rw-r--r--lib/fsm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index 022669a54..21e2a9d96 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -768,6 +768,7 @@ static int writeFile(/*@special@*/ FSM_t fsm, int writeData)
size_t pos = fdGetCpioPos(fsm->cfd);
char * symbuf = NULL;
int left;
+ int xx;
int rc;
st->st_size = (writeData ? ost->st_size : 0);
@@ -824,6 +825,7 @@ static int writeFile(/*@special@*/ FSM_t fsm, int writeData)
rdbuf = fsm->rdbuf;
fsm->rdbuf = (char *) mapped;
fsm->rdlen = nmapped = st->st_size;
+ xx = madvise(mapped, nmapped, MADV_DONTNEED);
}
#endif
@@ -850,7 +852,8 @@ static int writeFile(/*@special@*/ FSM_t fsm, int writeData)
#if HAVE_MMAP
if (mapped != (void *)-1) {
- /*@-noeffect@*/ (void) munmap(mapped, nmapped) /*@=noeffect@*/;
+ xx = msync(mapped, nmapped, MS_ASYNC);
+ /*@-noeffect@*/ xx = munmap(mapped, nmapped) /*@=noeffect@*/;
fsm->rdbuf = rdbuf;
}
#endif