[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch #6288] 30% speedup by changing one MALLOC() to a CALLOC()
From: |
Johan Walles |
Subject: |
[patch #6288] 30% speedup by changing one MALLOC() to a CALLOC() |
Date: |
Sat, 05 Jan 2008 08:55:19 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071119 Iceape/1.1.7 (Debian-1.1.7-1) |
Follow-up Comment #1, patch #6288 (project grep):
This is what the change looks like as described by diff. It still wins 30%
performance in a use-case I have once every hour of the day.
diff -ur grep-2.5.3/src/dfa.c grep-2.5.3-johan/src/dfa.c
--- grep-2.5.3/src/dfa.c 2007-06-28 20:57:19.000000000 +0200
+++ grep-2.5.3-johan/src/dfa.c 2008-01-05 09:46:54.000000000 +0100
@@ -1605,9 +1605,7 @@
int *visited;
position p, old;
- MALLOC(visited, int, d->tindex);
- for (i = 0; i < d->tindex; ++i)
- visited[i] = 0;
+ CALLOC(visited, int, d->tindex);
for (i = 0; i < s->nelem; ++i)
if (d->tokens[s->elems[i].index] >= NOTCHAR
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?6288>
_______________________________________________
Meddelandet skickades via/av Savannah
http://savannah.gnu.org/