porsager / wright

🚀 Work Fast Work Wright
Do What The F*ck You Want To Public License
180 stars 15 forks source link

High CPU usage #18

Closed cmnstmntmn closed 7 years ago

cmnstmntmn commented 7 years ago

i noticed that i'm running out of CPU soon after wright is started.

screen shot 2017-03-02 at 00 06 42

porsager commented 7 years ago

Interesting.

Could you post the output of setting debug to 1? Either -d 1 in the console or debug: 1 in js?

Thanks

cmnstmntmn commented 7 years ago
Starting wright...
Debug: { name: 'ui-kit',
  main: 'index.html',
  run: 'm.redraw',
  serve: '/Users/constantin/Sites/ui-kit',
  execute: [],
  watch: [ '**/*.html' ],
  js: 
   [ { watch: 'src/**/*.js',
       path: '/dist/app.js',
       compile: [Function: roll] } ],
  css: 
   [ { watch: 'src/css/**/*.css',
       compile: [Function: style],
       path: '/dist/app.css' } ],
  port: 3018,
  jail: true,
  debug: 1,
  fps: false,
  clone: false,
  set: [Function],
  id: 'Sites-ui-kit_88945a1',
  external: false,
  appData: '/Users/constantin/Library/Application Support/wright/Sites-ui-kit_88945a1',
  url: 'http://localhost:3018/',
  debugPort: 3019,
  debugProxyPort: 3020,
  debugUrl: 'http://localhost:3019' }
porsager commented 7 years ago

@cmnstmntmn I noticed that in the screenshot the node process has 3 hours and 35 minutes cpu time, which indicates it's been running for quite some time. Are you sure that node process was launched by wright? Can you replicate this easily?

cmnstmntmn commented 7 years ago

well, it's easy to replicate (in my case) is happening every time i'm running wright. i'll come with some extra details later today.

i'm wondering if some subprocesses are responsible for this issue; rollup, postcss that i'm using

porsager commented 7 years ago

There might be a watch in one of those running recursively? If it's something you can share could you put it in a gist?

cmnstmntmn commented 7 years ago

here's the config/plugins that i'm using

porsager commented 7 years ago

Files loaded in the browser needs to have a match inside the served folder.

When serve is not specified directly it will default to the current working directory or the base directory of the path in main.

In this case the solution was to either set serve: 'dist' or move index.html to dist and set main to main: 'dist/index.html'

I'll try to see if I can somehow make a better warning if wright tries to watch too many missing files..