Re: [lc-devel] Compressing a page using WKdm
Status: Beta
Brought to you by:
nitin_sf
From: Nitin G. <nit...@gm...> - 2006-06-09 15:23:00
|
On 6/9/06, Anderson Briglia <bri...@gm...> wrote: > > > I have been trying to compress a page using that WKdm code from > > > project's CVS. But, something is wrong because the system hangs after > > > some compression/decompression pages. I'm using this interface: > > > > > > to compress "original_page": > > > > > > int len; > > > len = WKdm_compress(page_address(original_page), page_address(comp_page), 1024); > > > memcpy(page_address(original_page), page_address(comp_page), len); > > > > > > to decompress: > > > > > > WKdm_decompress(page_address(original_page), page_address(decomp_page), 1024); > > > memcpy(page_address(original_page), page_address(decomp_page), PAGE_SIZE); > > > > > > Is needed to do some padding? I saw at compress_test module that the > > > comp_data is filled with 0's after the compression. Is it necessary? > > > > Yes, WKdm only works when input is exactly 1024 words. > > So, I guess I must do a loop if I want to compress one page-full of > data, right? A loop of four iteractions, of course. > No, I meant 1024 words==PAGE_SIZE (4K bytes). WKdm needs input of 4K bytes to work so you can compress a page with a single call. > > Are you compressing pages with less than page-full of data and still without > > padding? > > I'm compressing pages came from the shrink_list( ). I believe those > pages have PAGE_SIZE of data. > Are you just compressing and discarding pages as they come in shrink_list() or have you developed any compression structure to store pages and then later restore them when lookup is performed? Cheers, Nitin Gupta |