From 9f21406a4b8c589bcbda9103aaf8a350a69ac2ad Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 21 Oct 2013 20:48:00 +0200 Subject: [PATCH] Using cPickle in BigArray (faster and potentially less memory used) --- lib/core/bigarray.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/core/bigarray.py b/lib/core/bigarray.py index 85f64ddb8..37db36a93 100644 --- a/lib/core/bigarray.py +++ b/lib/core/bigarray.py @@ -5,8 +5,12 @@ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ +try: + import cPickle as pickle +except: + import pickle + import os -import pickle import tempfile from lib.core.settings import BIGARRAY_CHUNK_LENGTH @@ -62,7 +66,7 @@ class BigArray(list): self.filenames.add(filename) os.close(handle) with open(filename, "w+b") as fp: - pickle.dump(value, fp) + pickle.dump(value, fp, pickle.HIGHEST_PROTOCOL) return filename def _checkcache(self, index):