Need a Faster Compressor

Guillaume Boucher via Digitalmars-d digitalmars-d at puremagic.com
Sat May 21 15:41:49 PDT 2016


On Saturday, 21 May 2016 at 22:07:27 UTC, Walter Bright wrote:
> As mentioned elsewhere, the C++ mangling scheme has a primitive 
> and ineffective LZ77 scheme built in, so I wouldn't waste time 
> on that.

Sorry if I didn't memorize everything in this forum from the last 
20 years, can you give a link to some reasoning?

The only thing I found are some statements in 
https://github.com/dlang/dmd/pull/5793:

> Note that the VC++ and g++ name mangling schemes for C++ each 
> use a similar, but primitive (and fairly ineffective) form of 
> compression. It's like people who invent their own crypto 
> algorithms.

The name mangling in the Itanium C++ ABI is similar to LZ77 but 
heavily optimized for the typical use case in symbol names.  I 
don't really see how the general LZ77 would be better.  It's 
almost as if using information about the actual data leads to a 
better compression scheme.

> This is what C++ does, and results are pretty poor compression. 
> Scanning to determine the backward references would consume the 
> same order of time, anyway.

It uses a constant amount of time if implemented correctly, which 
is much faster.



More information about the Digitalmars-d mailing list