Explain SED code

Hi,

Can anyone pls explain me the below SED code in detail.

sed -e :a -e '$!N;s/\n//;ta' -e P -e D

When this code is executed with a file(has 1lac records), it is taking very long time to process.

So I wanted to modify this SED code with equivalant AWK code.

Thanks,
Sri

:a _______ sets the label "a"
$!N ______ as long as it is not the last line, take the next one and add it to be processed
s/\n// ____ substitute all newlines vs nothing ie. delete them
ta _______ as long as this all is true, go back to label "a" and repeat

Not sure on the following ones, someone can explain better maybe:
P _______ print the stuff that has been taken with N
D _______ deletes a part if it has been gathered with N

Maybe you show a part of your input file and add an example of the desired output you want. Use code tags when doing so, ty.