Okay time to improve performances, gprof session:
before  real 0m2.483s (2.3.2 release yesterday)
current real 0m1.763s
when parsing (with tree build/freeing) db10000.xml from XSLTMark:
- xmlmemory.h HTMLparser.c HTMLtree.c entities.c parser.c
  xpath.c xpointer.c tree.c uri.c valid.c xinclude.c xmlIO.c:
  avoiding memcpy in production builds MEM_CLEANUP macro use
- parser.[ch] parserInternals.c: optimizations of the tightest
  internal loops inside the parser. Better checking of I/O
  flushing/loading conditions
- xmllint.c : added --timing
Daniel
diff --git a/xpath.c b/xpath.c
index 63903f0..ff7a89b 100644
--- a/xpath.c
+++ b/xpath.c
@@ -906,14 +906,10 @@
 xmlXPathFreeNodeSet(xmlNodeSetPtr obj) {
     if (obj == NULL) return;
     if (obj->nodeTab != NULL) {
-#ifdef DEBUG
-	memset(obj->nodeTab, 0xB , (size_t) sizeof(xmlNodePtr) * obj->nodeMax);
-#endif
+	MEM_CLEANUP(obj->nodeTab, (size_t) sizeof(xmlNodePtr) * obj->nodeMax);
 	xmlFree(obj->nodeTab);
     }
-#ifdef DEBUG
-    memset(obj, 0xB , (size_t) sizeof(xmlNodeSet));
-#endif
+    MEM_CLEANUP(obj, (size_t) sizeof(xmlNodeSet));
     xmlFree(obj);
 }
 
@@ -934,14 +930,10 @@
 	    xmlFreeNodeList(obj->nodeTab[i]);
 
     if (obj->nodeTab != NULL) {
-#ifdef DEBUG
-	memset(obj->nodeTab, 0xB , (size_t) sizeof(xmlNodePtr) * obj->nodeMax);
-#endif
+	MEM_CLEANUP(obj->nodeTab, (size_t) sizeof(xmlNodePtr) * obj->nodeMax);
 	xmlFree(obj->nodeTab);
     }
-#ifdef DEBUG
-    memset(obj, 0xB , (size_t) sizeof(xmlNodeSet));
-#endif
+    MEM_CLEANUP(obj, (size_t) sizeof(xmlNodeSet));
     xmlFree(obj);
 }
 
@@ -1098,9 +1090,7 @@
 void
 xmlXPathFreeNodeSetList(xmlXPathObjectPtr obj) {
     if (obj == NULL) return;
-#ifdef DEBUG
-    memset(obj, 0xB , (size_t) sizeof(xmlXPathObject));
-#endif
+    MEM_CLEANUP(obj, (size_t) sizeof(xmlXPathObject));
     xmlFree(obj);
 }
 
@@ -1611,9 +1601,7 @@
 	    xmlXPathFreeValueTree(obj->nodesetval);
     }
 
-#ifdef DEBUG
-    memset(obj, 0xB , (size_t) sizeof(xmlXPathObject));
-#endif
+    MEM_CLEANUP(obj, (size_t) sizeof(xmlXPathObject));
     xmlFree(obj);
 }
 
@@ -1679,9 +1667,7 @@
     xmlXPathRegisteredNsCleanup(ctxt);
     xmlXPathRegisteredFuncsCleanup(ctxt);
     xmlXPathRegisteredVariablesCleanup(ctxt);
-#ifdef DEBUG
-    memset(ctxt, 0xB , (size_t) sizeof(xmlXPathContext));
-#endif
+    MEM_CLEANUP(ctxt, (size_t) sizeof(xmlXPathContext));
     xmlFree(ctxt);
 }
 
@@ -1758,14 +1744,10 @@
 void
 xmlXPathFreeParserContext(xmlXPathParserContextPtr ctxt) {
     if (ctxt->valueTab != NULL) {
-#ifdef DEBUG
-        memset(ctxt->valueTab, 0xB , 10 * (size_t) sizeof(xmlXPathObjectPtr));
-#endif
+        MEM_CLEANUP(ctxt->valueTab, 10 * (size_t) sizeof(xmlXPathObjectPtr));
         xmlFree(ctxt->valueTab);
     }
-#ifdef DEBUG
-    memset(ctxt, 0xB , (size_t) sizeof(xmlXPathParserContext));
-#endif
+    MEM_CLEANUP(ctxt, (size_t) sizeof(xmlXPathParserContext));
     xmlFree(ctxt);
 }