From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 4 17:14:29 2005 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A96DD16A41F; Fri, 4 Nov 2005 17:14:29 +0000 (GMT) (envelope-from babkin@verizon.net) Received: from vms044pub.verizon.net (vms044pub.verizon.net [206.46.252.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EA7443D5A; Fri, 4 Nov 2005 17:14:29 +0000 (GMT) (envelope-from babkin@verizon.net) Received: from vms062.mailsrvcs.net ([192.168.1.3]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IPF004RWX8432G2@vms044.mailsrvcs.net>; Fri, 04 Nov 2005 11:14:28 -0600 (CST) Date: Fri, 04 Nov 2005 11:14:28 -0600 (CST) From: Sergey Babkin To: Giorgos Keramidas , kamal kc Message-id: <29995980.1131124468471.JavaMail.root@vms062.mailsrvcs.net> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailman-Approved-At: Sat, 05 Nov 2005 17:13:10 +0000 Cc: freebsd , freebsd Subject: Re: Re: allocating 14KB memory per packet compression/decompression results in v X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: babkin@users.sf.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2005 17:14:29 -0000 >From: Giorgos Keramidas >On 2005-11-03 22:56, kamal kc wrote: >> since i am using the adaptive LZW compression scheme it >> requires construction of string table for >> compression/decompression. So an ip packet of size 1500 bytes >> requires a table of size (4KB + 4KB + 2KB = 12KB). > >I may be stating the obvious or something totally wrong, but >couldn't the string table be constructed once instead of each >time a packet goes down? It is my intuition that this would >perform much much better than re-doing the work of the string >table each time a packet goes out. No, the table changes as data is compressed. It records the knowledge about the strings that have already occured in the data. Keeping the table between the packets would improve the compression but the packets would have to be transmitted through a reliable medium since to decompress a packet you would have to decompress all the preceding packets first (essentially you get a stream compression). To keep the packets separate, the compression state must be reset between them. But of course resetting the compression state does not mean that the memory should be deallocated. -SB