From clamav-devel-bounces@lists.clamav.net  Thu Apr 12 19:40:37 2007
Return-Path: <clamav-devel-bounces@lists.clamav.net>
X-Original-To: list@tad.clamav.net
Delivered-To: list@tad.clamav.net
X-Virus-Scanned: Debian amavisd-new at tad.clamav.net
Received: from tad.clamav.net ([127.0.0.1])
	by localhost (tad.clamav.net [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 9IXlTh4F-BnV; Thu, 12 Apr 2007 19:40:37 +0200 (CEST)
Received: from tad.clamav.net (localhost.localdomain [127.0.0.1])
	by tad.clamav.net (Postfix) with ESMTP id C820B3940BD;
	Thu, 12 Apr 2007 19:40:35 +0200 (CEST)
X-Original-To: clamav-devel@tad.clamav.net
Delivered-To: clamav-devel@tad.clamav.net
X-Virus-Scanned: Debian amavisd-new at tad.clamav.net
Received: from tad.clamav.net ([127.0.0.1])
	by localhost (tad.clamav.net [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id a6qBnwBYDNk3 for <clamav-devel@tad.clamav.net>;
	Thu, 12 Apr 2007 19:40:35 +0200 (CEST)
Received: from yam.park.rambler.ru (yam.park.rambler.ru [81.19.64.116])
	by tad.clamav.net (Postfix) with ESMTP id DEB7931C029
	for <clamav-devel@lists.clamav.net>;
	Thu, 12 Apr 2007 19:40:34 +0200 (CEST)
Date: Thu, 12 Apr 2007 21:39:31 +0400
From: Anton Yuzhaninov <citrin@rambler-co.ru>
X-Mailer: The Bat! (v3.62.14) Professional
Organization: Rambler
X-Priority: 3 (Normal)
Message-ID: <713803205.20070412213931@rambler-co.ru>
To: clamav-devel@lists.clamav.net
MIME-Version: 1.0
Subject: [Clamav-devel] libclamav/blob.c: call cli_scanbuff() in
	fileblobAddData()
X-BeenThere: clamav-devel@lists.clamav.net
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: ClamAV Development <clamav-devel@lists.clamav.net>
List-Id: ClamAV Development <clamav-devel.lists.clamav.net>
List-Unsubscribe: <http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel>,
	<mailto:clamav-devel-request@lists.clamav.net?subject=unsubscribe>
List-Post: <mailto:clamav-devel@lists.clamav.net>
List-Help: <mailto:clamav-devel-request@lists.clamav.net?subject=help>
List-Subscribe: <http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel>,
	<mailto:clamav-devel-request@lists.clamav.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: clamav-devel-bounces@lists.clamav.net
Errors-To: clamav-devel-bounces@lists.clamav.net

Hello.

Why to  fileblobAddData() was added to call to cli_scanbuff()?

It add considerable performance degradation, but as I can see it don't
affect finding viruses (please correct me if I'm wrong, and without
this code some viruses may be not detected).

To test was used may incoming mail (including spam) and several
messages with viruses.

With call to cli_scanbuff in fileblobAddData():

460.48 user 57.59 sys (518.07 total)

Without call to cli_scanbuff (MAX_SCAN_SIZE was undefined)
197.41 user 38.73 sys (236.14 total)

May be code added in revision 1948 was intended to be optimization,
but on real mail (where viruses uncommon) it makes clamav two times
slower.

-- 
WBR,
 Anton Yuzhaninov
 Rambler

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

