Code Monkey home page Code Monkey logo

Comments (14)

danawoodman avatar danawoodman commented on June 7, 2024 1

Thanks @mikegleasonjr!

from gin.

danawoodman avatar danawoodman commented on June 7, 2024 1

Glad my bump resulted in so much awesome 👍 🍻 😄

from gin.

mariokostelac avatar mariokostelac commented on June 7, 2024

How much file do you have in your path (recursively)?
It is possible that delay of 500ms (between two checks for changes) could be too small for you (if fs/cpu is too busy and can't process app requests in between).
We should consider adding that as a cli parameter (or consider using file/dirwatchers for detecting changes) if that proves to be your problem.

@codegangsta do you want me to do that?

from gin.

johnsto avatar johnsto commented on June 7, 2024

I have this problem as well, caused by one of those bloody node_modules directories behemoths where I run Gin. Makes my CPU go nuts after a while.

The ability to specify which directories should be watched would be a huge improvement!

from gin.

zippoxer avatar zippoxer commented on June 7, 2024

+1 for that. node_modules is a real pain

from gin.

kokizzu avatar kokizzu commented on June 7, 2024

+1 mine too '___')

$ find . | wc
  25589   27322 1452620
$ find . -type 'd' | wc
   2052    2173   84120
$ find . -iname '*.go' | wc
    144     144    3617
$ find .git | wc
     83      83    2374
$ find resources/ | wc # this folder will never ever be compiled
  24311   26044 1361828
$ find resources/ -type 'd' | wc
   1935    2056   78388

an exclusion flag will be nice, for example:

gin -i -b /tmp/test --exclude resources/

from gin.

mikegleasonjr avatar mikegleasonjr commented on June 7, 2024

👍

Is this project dead? Any alternatives?

from gin.

vektah avatar vektah commented on June 7, 2024

#83 fixes this issue. Sadly it its unmerged.

I have a fork with that PR merged to master over at https://github.com/vektah/gin so it can be go get github.com/vektah/gin

from gin.

danawoodman avatar danawoodman commented on June 7, 2024

Bump...

from gin.

mikegleasonjr avatar mikegleasonjr commented on June 7, 2024

I ended up using fswatch:

Not a shell guru so bare with me:

$ fswatch -0 -or --include ".*\.go$" --exclude ".*" . | xargs -0 -t -n 1 -I {} go install -v github.com/your/server &
$ fswatch -0 -or $GOPATH/bin/server | xargs -0 -t -n 1 -I {} sh -c 'killall server; $GOPATH/bin/server &> optional.log &' &

The first line rebuilds and installs your package when *.go changes, the second listens for a change of your installed server. (sometimes rebuilding does not yield a new binary, just a small optimization)

When I'm done, I killall fswatch and killall server. I was using prm anyway so I had startup and stop scripts at my disposition to automate that.

Lighter, more portable, faster, easier to run, etc..

from gin.

ibash avatar ibash commented on June 7, 2024

#83 is merged!

from gin.

mikeifomin avatar mikeifomin commented on June 7, 2024

I have excluded all huge directories with the excludeDir but still cpu is about 40% on idle .(
mac os 10.12.4

from gin.

mikeifomin avatar mikeifomin commented on June 7, 2024

oops there was just a typo. All fixed.

from gin.

kokizzu avatar kokizzu commented on June 7, 2024

--excludeDir unnecessaryDir especially directories with node_modules helps a lot (14% cpu usage to 0-2%)

from gin.

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.