Why is (monad) elegance so costly?

marku@cs.waikato.ac.nz marku@cs.waikato.ac.nz
Sat, 20 Oct 2001 05:49:16 +1300 (NZDT)


------=_2Pp1rZHtxc's,=rxx6uOgF1pZK(kYu5C2P4D/gu_zt5Svqo7lFt:(LBZo,K'
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I am about to rewrite my Z animation tool (JAZA) in a style that
makes more intensive use of state monads.

However, my experiments with a simplified lambda-calculus example
shows that (with GHC 5.00) the state monad is dramatically less
efficient than the simple identity monad:

    4 TIMES SLOWER, and
    7 TIMES MORE MEMORY!

Is this normal?  Acceptable?  Am I doing something wrong?

Can anyone suggest ways of reducing these overheads?

(I am very keen to use state-monads if possible, because it allows
my 'eval' code to be generic over the monad that is used, which
allows me to reuse the code with other similar monads.  In fact,
I am using it to simulate the 'visitor' design pattern from OO langs.)

Hugs gives slightly smaller differences (3 times more reductions and 
3.5 times more cells), but I had hoped that GHC would be able to
optimize most of the state monad overhead away  (especially when
the monad uses newtype)?

My code and speed measurements are attached.

Mark.


------=_2Pp1rZHtxc's,=rxx6uOgF1pZK(kYu5C2P4D/gu_zt5Svqo7lFt:(LBZo,K'
Content-Type: application/octet-stream;name="LambdaCalc.hs"
Content-Disposition: attachment; filename="LambdaCalc.hs"
Content-Transfer-Encoding: base64

bW9kdWxlIE1haW4KLS0gRXhwZXJpbWVudHMgd2l0aCBIaWdoZXItT3JkZXIgbWFwcGluZ3Mgb3Zl
ciB0ZXJtcy4KLS0gU3BlZWQgY29tcGFyaXNvbnMgb2YgcGFzc2luZyBlbnZpcm9ubWVudHMgaW4g
YSBtb25hZCwgdmVyc3VzIGV4cGxpY2l0bHkuCi0tCi0tICBXaXRoIEh1Z3M5OCBGZWIgMjAwMTog
IChLIHJlZHVjdGlvbnMvIEsgY2VsbHMpCi0tICAgICBOICAgICAgIG1haW5TaW1wbGUgICAgICAg
ICAgICBtYWluTW9uYWQKLS0gICAgICAgICAgICAgUmVkbnMgICBDZWxscyAgICAgICBSZWRucyAg
ICBDZWxscwotLSAgICAgMTAgICAgICAgICA0LjcgICAgIDggICAgICAgICAgMTUgICAgICAyOAot
LSAgICAgMjAgICAgICAgIDE2LjAgICAgMjcgICAgICAgICAgNDkgICAgICA5MgotLSAgICAgMzAg
ICAgICAgIDMzLjUgICAgNTcgICAgICAgICAxMDIgICAgIDE5MgotLSAgICAgNDAgICAgICAgIDU4
ICAgICAgOTggICAgICAgICAxNzUgICAgIDMyOQotLSAgICAgNTAgICAgICAgIDg5ICAgICAxNTAg
ICAgICAgICAyNjggICAgIDUwMgotLSAgICAgODAgICAgICAgMjIxICAgICAzNzMgICAgICAgICA2
NjQgICAgMTI0MgotLSAgICAxNjAgICAgICAgODY1ICAgIDE0NTYgICAgICAgIDI1ODIgICAgNDgy
NgotLSAgICAzMjAgICAgICAzNDE5ICAgIDU3NTQgICAgICAgMTAxODEgICAxOTAyMQotLQotLSBX
aXRoIEdIQyA1LjAwLjEKLS0gICAgIE4gICAgICAgbWFpblNpbXBsZSAgICAgICAgICAgIG1haW5N
b25hZAotLSAgICAgICAgICAgICBzZWNzICAgIEtieXRlcyAgICAgICAgIHNlY3MgICAgS2J5dGVz
Ci0tICAgICAxMDAgICAgIDAuMDIgICAgICAxMTgwICAgICAgICAgMC4wOCAgICAgIDgyMTMKLS0g
ICAgIDIwMCAgICAgMC4wODAgICAgIDQ1MjkgICAgICAgICAwLjMwICAgICAzMTk5NwotLSAgICAg
NDAwICAgICAwLjMxMCAgICAxNzg1MCAgICAgICAgIDEuMzYgICAgMTI2MzMzCi0tICAgICA4MDAg
ICAgIDEuNTQgICAgIDcwOTI4ICAgICAgICAgIDYuNiAgICA1MDIwOTYKLS0gIDEgMTYwMCAgICAg
Ny42NiAgICAyODI4MzMgICAgICAgICAzNC42ICAgMjAwMTk2MwotLSAgMiAxNjAwICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIDI4Ljc2ICAxNzI1MTI4ICAxIHdpdGggbmV3dHlwZQotLSAgMyAx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