larshp / abapmerge

Merge ABAP classes/interfaces/INCLUDEs into single file
MIT License
24 stars 14 forks source link

ABAP minifier #76

Open larshp opened 8 years ago

larshp commented 8 years ago

As noted in https://github.com/larshp/abapGit/pull/467 the "compiled" version of abapGit is getting quite large.

As a joke I suggested writing a ABAP minifier, but perhaps it is not totally stupid?

Wonder how much the source code can be reduced if:

guess this would be a new project in some language that can run on travis(javascript?)

eduardocopat commented 8 years ago

Couldn't the abapMerge do this? Something like abapmerge --minify

larshp commented 8 years ago

yeah

Sirius-A commented 7 years ago

I wrote a minifier for abapmerge (See: https://github.com/Sirius-A/abapmerge)

Results

Normal ABAPGit:    1.31 MB (1375246 Bytes)
Minified AbapGit:   848 KB  (868582 Bytes)

-->minified version is around 60% of its normal size.

Note: I did not not test the minified code on a SAP system yet. I'll PR when I made sure it works.

larshp commented 7 years ago

did some testing, it seems like the editor and/or abap parser is not very happy with the very long 1 line of code.

perhaps try adding newline(at appropriate places) after each 1000 bytes

UPDATE: it looks like the editor automatically splits after 255 bytes image

fabianlupa commented 7 years ago

One thing to consider might be that there are legacy function modules which read the uncompiled source code from the database and analyze it line by line with a line variable typed as CHAR80 which causes a dump if there is any line longer than 80 characters. I would not bother trying to support that, just so you know.