From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 1 01:01:09 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB43216A41A for ; Thu, 1 Nov 2007 01:01:09 +0000 (UTC) (envelope-from nec556@retena.com) Received: from resmaa07.ono.com (mta.auna.com [62.42.230.187]) by mx1.freebsd.org (Postfix) with ESMTP id 9B66313C48A for ; Thu, 1 Nov 2007 01:01:08 +0000 (UTC) (envelope-from nec556@retena.com) Received: from argente-2005.retena.com (83.173.188.82) by resmaa07.ono.com (7.3.118.8) (authenticated as nec556@retena.com) id 4727D3B2000A88A6 for freebsd-hackers@freebsd.org; Thu, 1 Nov 2007 01:05:57 +0100 Message-ID: <4727D3B2000A88A6@> (added by postmaster@resmaa07.ono.com) X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Date: Thu, 01 Nov 2007 01:05:54 +0100 To: freebsd-hackers@freebsd.org From: Eduardo Morras Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: memory pool, rfc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2007 01:01:09 -0000 Hello: I have some free time and want to do an memory pool. The idea is to have a memory zone of N KB (or several MB) compressed in memory. I have fast compression algorithms now that can release under BSD licence that are faster than hd i/o, so it take less compress/decompress a memory zone than read/write it to disk. I don't know if it already exist for FreeBSD, so if it's already done i'll try to improve it. - Each memory chunk is compressed separately, so i can decompress and use one without decompress anyother one. - In 4KB chunks of text i get 50-60 % compression (avg 2 - 1.6 KB result) - In 4KB chunks of binary (application code) i get 30-40 % compression (avg 2.8 - 2.4 KB result) - In both cases, results may vary depending on data type and chunk size, greater implies better compression - Speed once implemented will be very fast. Current speed hogs a PATA 133 disk. For what can be used? - Memory pools in applications (like malloc) - Ram disks - Disk Cache (permit bigger disk cache) - 'On the fly' filesystem compression (and it takes less read/write compressed data than non-compressed) - Perhaps add it as Virtual Memory swap cache? - Other Don't point me to zlib or libbzip2, they are on another league and are much slower than my code. Thanks