Coder Social home page Coder Social logo

Comments (14)

michaelpj avatar michaelpj commented on August 26, 2024 1

If that's the only blocker we could fork and fix, and add the fork as a git dependency.

from plutus.

michaelpj avatar michaelpj commented on August 26, 2024

I did some debugging of this a while ago (I think it's the same issue that's affecting our doctests). You can gdb attach to the process and get a stack trace, which I think indicated that it was definitely something in module loading.

However, I also had a look and I'm pretty sure we're using dynamically linked libraries, but I'm not an expert on this so I might have got this wrong (I think I just looked at the output of ldd on things, and it looked like there were lookup paths).

from plutus.

shmish111 avatar shmish111 commented on August 26, 2024

Hmm, currently we can't use ghc 8.6 because of eskimor/servant-subscriber#19 so I will try a hint-only project to see at least if this will solve it in the future. Try ghci first though.

from plutus.

shmish111 avatar shmish111 commented on August 26, 2024

So, with servant subscriber fixed (I have submitted a PR) we are now blocked by https://ghc.haskell.org/trac/ghc/ticket/16104 which will no doubt take quite a few months before it is available to us (we want it in a stackage LTS really). See #461

I will move on to GHCI

from plutus.

shmish111 avatar shmish111 commented on August 26, 2024

so on a machine where the server warmup takes almost 1 minute, ghci loads files in less than 1 second and takes less to start up. This is using the same ghc lib dir as hint is using. The only difference between this test and hint is that hint is running within a Haskell process which maybe causes some contention in the way ghc is loading things. I think this test is successful enough to move on to trying to embed ghci in the haskell server and see what happens.

from plutus.

michaelpj avatar michaelpj commented on August 26, 2024

Yes, that makes sense - it's also the case that I've been able to use ghci-as-a-process just fine in the projects where the doctests are slow, so it does seem to be something about using it as a library.

from plutus.

mchakravarty avatar mchakravarty commented on August 26, 2024

This is bizarre in so far as ghci also just uses GHC as a library. (However, I am not objecting to the plan. Tracking down whether it is due to hint or some other incidental difference in how GHC gets configured may be very time consuming and maybe just going for the simple solution is the easiest approach and simplifies maintenance in the long run.)

from plutus.

shmish111 avatar shmish111 commented on August 26, 2024

Currently I'm actually looking at runghc as dealing with a single session of ghci will be very complicated in terms of parsing the output. A quick play around of runghc on the command line with some of our contracts showed it to have an unnoticeable performance difference and running a single command per server request is much easier

from plutus.

shmish111 avatar shmish111 commented on August 26, 2024

This is fixed by moving from hint to runghc

from plutus.

krisajenkins avatar krisajenkins commented on August 26, 2024

This is now merged, tested and pending release. See #514.

from plutus.

mpickering avatar mpickering commented on August 26, 2024

FWIW, the other workaround is to compile the executable which uses the GHC API using -dynamic.

from plutus.

shmish111 avatar shmish111 commented on August 26, 2024

@mpickering oh really, wow. I think runghc is currently a better solution anyway as it allows spawning as many processes as we require and seems to have almost no overhead.

from plutus.

shmish111 avatar shmish111 commented on August 26, 2024

@mpickering can you explain why? or is it just magic :D

from plutus.

mpickering avatar mpickering commented on August 26, 2024

It's not clear yet but it's something to do with using the system linker vs the linker built into GHC.

See https://gitlab.haskell.org/ghc/ghc/issues/15524

from plutus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.