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
generate compressed tables #28
Comments
I have not objections to giving it a try.
|
Indeed :)
Just to clarify, are you referring to (1) the time it takes for Gocc to produces the source files, (2) the time it takes for the Go compiler to compile the generated source files, or (3) the time it takes to run the generated parsers? In the case of (2), this is a bug in the later versions of the Go compiler, and is being tracked upstream at golang/go#14934 and golang/go#16407.
I'm still interested to understand precisely which bottle neck you are referring to, (1), (2) or (3) or something else?
Definitely keep the current one default.
As part of this effort to generate compressed tables, may we take a look at adding proper support for David Pager's "Practical General Method" as motivated by Marius in #13 (comment)
Then perhaps the command line flag could be |
I really like the Pager option. |
I am proposing to do the compression of the tables, on my own time (which shouldn't take too long), but I won't have time to do pager as well, since this will be a very time consuming effort requiring time to understand the theory and time for extra testing. On your question of "which time". I had to compress my gogoprotobuf generated code because of issue (2), but then I gained (1) and this has really sped up my development time. Obviously I also want smaller source files and faster compilation. But the main purpose is faster code generation, since this has become my main bottleneck when developing. I love the quick feedback loop that golang gives me and I want to keep that high even if I am doing some code generation. Given that I am proposing to do this work, I just want to know whether you,@goccmack and @mewmew support this work without me starting a journey down pager theory? |
I do |
Sure, go for it. We may always evaluate the performance of
As a work around, you may try using Go 1.4. It does speed up compilation quite a bit for katydid. Go 1.4
Go 1.6
Go tip
|
Yes totally. Having it as an experimental flag sounds perfect :) Wow that is a huge difference in compilation speed. Thanks for the effort. |
Perfect. Go for it. |
Thank you for both of your approval. |
For reference, issue golang/go#14934 and golang/go#16407 have now been fixed, resulting in a tremendous improvement in compile time. For the Gocc generated code of golang/go#14934, a 38x slowdown was noticed between Go 1.4 and Go tip (at rev golang/go@0659cf6). This has been brought down to roughly 2x at the latest Go tip (rev golang/go@da6b9ec). The main commit dealing with this issue was golang/go@5a6e511, which introduced a new phi placement algorithm (the Sreedhar+Gao phi building algorithm). @awalterschulze, you may not have to generate the compressed tables if the new compile times are good enough. Then we can focus on introducing Pager at some point in the future. |
Interesting :) |
That's correct. |
@awalterschulze Do you want to keep this issue open? Or should we close it since #31 has been merged. We could then open a dedicated issue for Pager support. |
Yes this can now be closed
…On Sat, 3 Dec 2016, 19:09 Robin Eklind, ***@***.***> wrote:
@awalterschulze <https://github.com/awalterschulze> Do you want to keep
this issue open? Or should we close it since #31
<#31> has been merged. We could then
open a dedicated issue for Pager support.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvsLVlJEPBLK2FFNsp1b9J8K-V6l5ISks5rEbBWgaJpZM4JRnQm>
.
|
…ne coverage tracking. Updates goccmack/gocc#28.
The generated tables can become quite large
https://raw.githubusercontent.com/katydid/katydid/master/relapse/parser/actiontable.go
and this is the reason they are generated and not typed by a human :)
The current tables are great output for debugging, but in production we don't really care how pretty they are printed.
A bigger concern is how long it takes to generate the code and the size of the generated code.
I have cut down my code generation time in gogoprotobuf by 4 times just by rather generating a compressed FileDescriptorProtoSet object. The generated function in that case still returns the uncompressed version, so the API has not changed.
I suspect we can cut down on the gocc code generation time by quite a bit by simply printing a compressed table. Something like the following.
Maybe I am wrong and this is not the bottle neck, but then at least we still get a smaller code size.
I still think the current table output should be kept as the default.
We can add a flag (-min) to gocc which will then generate the compressed tables.
What do you think @goccmack @mewmew
The text was updated successfully, but these errors were encountered: