beam icon indicating copy to clipboard operation
beam copied to clipboard

defaultDbSettings slow to build in release mode

Open ollef opened this issue 6 years ago • 3 comments

Changing this line:

folq :: DatabaseSettings be Folq
folq = defaultDbSettings

to

folq :: DatabaseSettings be Folq
folq = undefined

saves about 40 seconds of build time on my machine. Here Folq is a database with around 20 tables. If I build without optimisation (by passing --fast to Stack) it only saves about a second, which I can live with.

Is there any way to speed this up?

Cheers!

ollef avatar Mar 19 '19 10:03 ollef

It seems likely that this is due to the general problem that GHC is slow at handling generics, and therefore that the problem is not Beam-specific. I had a look at the -ddump-simpl output from the definition, and it's got huge generic type representations in it, which perhaps points in that direction.

I would still be interested in hearing if there are any coping strategies, though.

ollef avatar Mar 19 '19 12:03 ollef

I've been experimenting with INLINEing which actually reduces the code by getting rid of some of the intermediate representations in the core. I'll have to run some benchmarks though.

tathougies avatar Mar 19 '19 15:03 tathougies

Cool! Let me know if I can help test anything.

ollef avatar Mar 19 '19 15:03 ollef