Permalink
Browse files

improved scheduler

  • Loading branch information...
neelance committed Feb 5, 2017
1 parent a963318 commit 2d0acd02933cf349b065398c73490a14f7d9bada
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
View
@@ -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

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Feb 17, 2017

Member

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

Member

dmitshur replied Feb 17, 2017

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

@neelance

This comment has been minimized.

Show comment
Hide comment
@neelance

neelance Feb 17, 2017

Member

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

Member

neelance replied Feb 17, 2017

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

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Feb 18, 2017

Member

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

Member

dmitshur replied Feb 18, 2017

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

Please sign in to comment.