Differences From Artifact [328ba1ead5]:
- File src/natools-smaz_generic.adb — part of check-in [4b73acb2a8] at 2016-11-13 21:42:05 on branch trunk — smaz_generic: new package attempting generic Smaz-like compression (user: nat size: 8433)
To Artifact [c2e4810a49]:
- File
src/natools-smaz_generic.adb
— part of check-in
[674fadc74b]
at
2016-12-16 20:55:19
on branch trunk
— smaz_generic: optimize compression
For some reason it seems even with -O3, calling Dict_Entry involves a string copy, which makes `memcpy` the larger time consumer of the copmpression algorithm. Inlining it manually improves performance a lot. (user: nat size: 8566)
| ︙ | ︙ | |||
61 62 63 64 65 66 67 |
Is_Valid := True;
end if;
exception
when Constraint_Error => null;
end To_Code;
if Is_Valid
| | > > | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
Is_Valid := True;
end if;
exception
when Constraint_Error => null;
end To_Code;
if Is_Valid
and then Template (Template'First .. Last)
= Dict.Values (Code_First (Dict.Offsets, Code, Dict.Values'First)
.. Code_Last (Dict.Offsets, Code, Dict.Values'Last))
then
Length := 1 + Last - Template'First;
return;
end if;
end loop;
end Find_Entry;
|
| ︙ | ︙ |