Need a Faster Compressor
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Sun May 22 12:53:35 PDT 2016
On 5/22/2016 10:44 AM, Rainer Schuetze wrote:
> You are right about the symbols using the VC mangling. The test case
> "1.s.s.s.s.s" in the bugreport translated to C++ yields
>
> ?foo at Result@?1???$s at UResult@?1???$s at UResult@?1???$s at UResult@?1???$s at UResult@?1???$s at H@testexpansion@@YA at H@Z@@testexpansion@@YA at U1?1???$s at H@2 at YA@H at Z@@Z@@testexpansion@@YA at U1?1???$s at UResult@?1???$s at H@testexpansion@@YA at H@Z@@2 at YA@U1?1???$s at H@2 at YA@H at Z@@Z@@Z@@testexpansion@@YA at U1?1???$s at UResult@?1???$s at UResult@?1???$s at H@testexpansion@@YA at H@Z@@testexpansion@@YA at U1?1???$s at H@2 at YA@H at Z@@Z@@2 at YA@U1?1???$s at UResult@?1???$s at H@testexpansion@@YA at H@Z@@2 at YA@U1?1???$s at H@2 at YA@H at Z@@Z@@Z@@Z@@testexpansion@@YA at U1?1???$s at UResult@?1???$s at UResult@?1???$s at UResult@?1???$s at H@testexpansion@@YA at H@Z@@testexpansion@@YA at U1?1???$s at H@2 at YA@H at Z@@Z@@testexpansion@@YA at U1?1???$s at UResult@?1???$s at H@testexpansion@@YA at H@Z@@2 at YA@U1?1???$s at H@2 at YA@H at Z@@Z@@Z@@2 at YA@U1?1???$s at UResult@?1???$s at UResult@?1???$s at H@testexpansion@@YA at H@Z@@testexpansion@@YA at U1?1???$s at H@2 at YA@H at Z@@Z@@2 at YA@U1?1???$s at UResult@?1???$s at H@testexpansion@@YA at H@Z@@2 at YA@U1?1???$s at H@2 at YA@H at Z@@Z@@Z@@Z@@Z at QAEXXZ
Haha, thus showing why people should never invent their own ad-hoc crypto nor
compression algorithms :-)
> _ZZN13testexpansion1sIZNS0_IZNS0_IZNS0_IZNS0_IiEEDaT_E6ResultEES1_S2_E6ResultEES1_S2_E6ResultEES1_S2_E6ResultEES1_S2_EN6Result3fooEv
Note "Result" appearing 5 times. It's still crappy compression. Ironically, this
design predates the much worse VC++ one.
> which is only 39 characters longer than the compressed version of the D symbol.
> It uses a much smaller character set, though.
The much smaller character set can be done, if desired, by using base64
encoding. The compressor is careful to not emit 0 bytes, as those definitely
would screw up bintools, but the rest seem unperturbed by binary strings.
More information about the Digitalmars-d
mailing list