Permalink
Browse files

improved scheduler

  • Loading branch information...
1 parent a963318 commit 2d0acd02933cf349b065398c73490a14f7d9bada @neelance neelance committed Feb 5, 2017
Showing with 89 additions and 97 deletions.
  1. +1 −1 compiler/compiler.go
  2. +76 −76 compiler/natives/fs_vfsdata.go
  3. +1 −1 compiler/natives/src/time/time.go
  4. +11 −19 compiler/prelude/goroutines.go
@@ -168,7 +168,7 @@ func WriteProgramCode(pkgs []*Archive, w *SourceMapFilter) error {
}
}
- if _, err := w.Write([]byte("$synthesizeMethods();\nvar $mainPkg = $packages[\"" + string(mainPkg.ImportPath) + "\"];\n$packages[\"runtime\"].$init();\n$go($mainPkg.$init, [], true);\n$flushConsole();\n\n}).call(this);\n")); err != nil {
+ if _, err := w.Write([]byte("$synthesizeMethods();\nvar $mainPkg = $packages[\"" + string(mainPkg.ImportPath) + "\"];\n$packages[\"runtime\"].$init();\n$go($mainPkg.$init, []);\n$flushConsole();\n\n}).call(this);\n")); err != nil {
return err
}
Oops, something went wrong.

3 comments on commit 2d0acd0

@shurcooL
Member

@neelance What was the effect of this improvement? Is it just better code quality, or are there performance improvements, etc.?

@neelance
Member

The main point is that the Go scheduler now runs directly in a JS callback, there is no setTimeout($runScheduled, 0) any more.

@shurcooL
Member

Got it, thanks. I highly suspect this explains gopherjs/gopherjs.github.io@723a993.

Please sign in to comment.