Difference between 'lib' directory and 'programs' directory?

50 views
Skip to first unread message

Vishnu s kumar

unread,
Mar 29, 2016, 11:51:43 AM3/29/16
to LZ4c
Hello,

This is my first open source program, and I find difficulty understanding the purpose of different directories in the lZ4.

1.What is the purpose of 'lib' and  ' programs' directory?

2.To which directory I can do my contribution among these two, in order to improve the performance ? 

Thank You! 

Takayuki Matsuoka

unread,
Mar 29, 2016, 2:35:53 PM3/29/16
to LZ4c
Hi,

> 1.What is the purpose of 'lib' and  ' programs' directory?

"lib" directory contains LZ4's library (core) part.  "program" directory contains application programs which use LZ4 library: LZ4 command line utility, I/O submodule and test tools (e.g. benchmark).


> 2.To which directory I can do my contribution among these two, in order to improve the performance ?

It depends.
For example, issue #116 https://github.com/Cyan4973/lz4/issues/116 - overlapped (or multi-threaded) I/O is one of the most awaited and frequently asked feature.  It may be achieved by modifying mainly programs/lz4io.c.
Another example is pull request #188 https://github.com/Cyan4973/lz4/pull/188 - optimization for frequent dictionary reloading.  It adds some functions and structure to lib/lz4.[hc].

Regards,

Vishnu s kumar

unread,
Mar 29, 2016, 11:25:39 PM3/29/16
to LZ4c
Thank You once again, Takayuki 

I actually have one more doubt. Could you please explain me in brief the working of the compressor and the decompressor. I understood everything on the ReadMe files, but none of them actually explains the working of the compressor or decompressor.

Takayuki Matsuoka

unread,
Mar 30, 2016, 9:25:16 AM3/30/16
to LZ4c
> Could you please explain me in brief the working of the compressor and the decompressor.

Sorry, but I don't explain anything for you.  Please read codes and documents in the repository.  Note that LZ4 repository has its entire history, so you can study older and simpler LZ4.
You can also find many LZ77 (de)compressor on the Internet and CS related books.  Or ask your teachers about it.  I'm 100% sure they'll happily recommend many good books for you.


> I understood everything on the ReadMe files, but none of them actually explains the working of the compressor or decompressor.

Actually, Block Format document implicitly descripts how LZ4 decompress its compressed data.
https://github.com/Cyan4973/lz4/blob/master/lz4_Block_format.md

Also early versions of LZ4 are good start point to understand LZ4's core idea.
https://github.com/Cyan4973/lz4/tree/36104610053f34bbe033fad50263ce33cd4e9bcc

And evolution of the "LZ4_WILDCOPY()" and unaligned access related optimizations would be quite interesting.  If you track its history, you see Yann's struggle for speed and compatibility.  After that, you'll be surprised its final form.
https://github.com/Cyan4973/lz4/blob/e1ae3a0b958c03ac5162f4852f183bdd0e6580f4/lz4.c#L105

Vishnu s kumar

unread,
Mar 30, 2016, 10:13:48 AM3/30/16
to LZ4c
Okay. Thank You, Takayuki. I was looking for some information like this. It is really gonna be helpful. 
Reply all
Reply to author
Forward
0 new messages