Skip to content

77 seconds to run hello world #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alanjds opened this issue Aug 21, 2018 · 4 comments
Closed

77 seconds to run hello world #57

alanjds opened this issue Aug 21, 2018 · 4 comments
Labels
imported Imported from google/grumpy

Comments

@alanjds
Copy link

alanjds commented Aug 21, 2018

google#388 opened by @ShakataGaNai on Dec 8, 2017

  • checked out from git today: google@3ec8795
  • go version go1.9.2 darwin/amd64
  • Mac on 10.26.6 Sierra
  • Darwin SM0948 16.7.0 Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64 x86_64 i386 MacBookPro14,2 Darwin

image

77 seconds to compile the hello world, this was the second time I ran it - so if there is cacheing/downloading to do - it should have already done it. I think the first time was even slower than this, but I didn't time that.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by vbarbaresi
Thursday Jan 04, 2018 at 18:00 GMT


I can reproduce on OSX Sierra as well.
For some reason, on the second make run, a lot of targets remain:

$ echo "print 'hello, world'" | make run -n
mkdir -p build/src/__python__/__go__/grumpy
build/bin/pkgc grumpy > build/src/__python__/__go__/grumpy/module.go
mkdir -p build/pkg/darwin_amd64/__python__/__go__
go install __python__/__go__/grumpy
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/__builtin__.a -p __python__/__builtin__ -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/__builtin__/module.go
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/sys.a -p __python__/sys -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/sys/module.go
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/cStringIO.a -p __python__/cStringIO -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/cStringIO/module.go
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/exceptions.a -p __python__/exceptions -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/exceptions/module.go
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/thread.a -p __python__/thread -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/thread/module.go
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/_collections.a -p __python__/_collections -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/_collections/module.go
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/itertools.a -p __python__/itertools -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/itertools/module.go
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/os.a -p __python__/os -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/os/module.go
mkdir -p build/pkg/darwin_amd64/__python__
go tool compile -o build/pkg/darwin_amd64/__python__/linecache.a -p __python__/linecache -complete -I build/pkg/darwin_amd64 -pack build/src/__python__/linecache/module.go
mkdir -p build/pkg/darwin_amd64/__python__
[...]

Although the .a files already exist, they will be rebuilt, not sure why

From the third run it stops compiling and works fast

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by alanjds
Friday Feb 23, 2018 at 15:43 GMT


Just to inform: I am working on this issue.

$ echo "print 'hello, world'" | time grumpy run
hello, world
        0.90 real         0.85 user         0.22 sys
$ uname -a
Darwin mymachine.local 16.0.0 Darwin Kernel Version 16.0.0: Mon Aug 29 17:56:20 PDT 2016; root:xnu-3789.1.32~3/RELEASE_X86_64 x86_64

Machine: MacBookPro12,1

Will followup later. Yet a lot of stuff to optimize on the importing routines

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by alanjds
Thursday May 17, 2018 at 13:49 GMT


Just published a "grumpy-runtime" package on PyPI. It installs the grumpy CLI tool and compiles the runtime on your machine. Took 3 min. on my notebook.

Then you can run:

$ echo "print 'hello'" | grumpy run

And it takes ~2 seconds on my machine.

Published yesterday and is very beta right now, but opens world to cache compiled stuff on __pycache__ folders.

Please provide feedback if you can.

@alanjds alanjds added the imported Imported from google/grumpy label Aug 21, 2018
@alanjds
Copy link
Author

alanjds commented Sep 2, 2018

The actual Grumpy version 0.3.0 takes about 3 seconds. I will close this issue. Please reopen if needed:

$ time grumpy -c 'print "hello world"'
hello world

real	0m2.257s
user	0m1.262s
sys	0m0.730s

@alanjds alanjds closed this as completed Sep 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported Imported from google/grumpy
Projects
None yet
Development

No branches or pull requests

1 participant