-
Notifications
You must be signed in to change notification settings - Fork 77
flatbuf: regenerate using optimized flatc #559
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
base: main
Are you sure you want to change the base?
Conversation
|
Is there any possibility of getting the optimizations pushed upstream in the flatbuffer compiler? Otherwise we should at least update the README or something to ensure that future regenerating of the flatbuffer files uses the same compiler patches |
I'm trying, but realistically it's a Google project. I honestly doubt they're going to even look at it; they get bonuses for ruining public-facing projects, not for making things better.
That's definitely fair - would you want to host the compiler patches somewhere yourself? It's one reason I wanted to split this out into its own PR; I'm not sure the best way to handle it. If it was my project, I'd just link to my own patches, but - it's not :) |
|
Do we have a sense of how hard it would be to keep these patches maintained? |
|
(Also, is there a PR upstream that we can look at? I agree that Google seems unlikely to care, but we should at least try.) |
+1 |
|
google/flatbuffers#8744 <- yes, I did open one upstream @lidavidm @kou. If they engage with me I intend to push for it. I need to figure out the CLA status and such though. |
|
Thanks! I'm going to try poking around my network to see if I can find any chain that leads to a Flatbuffer owner but, well, I have low hopes... |
|
Thanks. It seems that your need to sign a CLA: google/flatbuffers#8744 (comment) Could you check it? |
|
Ah, sorry. You already mentioned the CLA status. |
|
Yeah, I need to double check. Contributing to Arrow is definitely fine, but Google's asking for more than just a contribution under an Apache license, they effectively want total ownership in all but name, and I don't think I want to try and get permission to give them that, frankly. |
Can't say for sure, given that I don't know what upstream looks like, but FWIW: I developed the patches on internal/flatbuf first, not knowing it was generated code, and then it took me all of... ten minutes? to figure out how to patch the Go code generator, and that's without having touched C++ in ~5 years. So, I'd guess "not very hard." Especially since the logic of the patch is quite straightforwards:
|
FWIW: simple enough that I'd be totally fine committing to maintaining it myself, if we knew each other enough for that to mean anything 😅 |
89164b8 to
491042c
Compare
|
Rebased and lint fixed |
Regenerates the flatbuf package using the optimized flatbuffer compiler here. It's a pretty straightforward patch; it basically just passes internal values along the stack instead of by pointers (which necessitates heaps allocations). The ipc package is adjusted accordingly, to use the adjusted APIs.
I know editing generated code is usually not looked on super favorably, but IMO the performance win is sufficient to justify it.
Also addresses the
// FIXME(sbinet) refactor msg-header handling.; with the Table exposed directly (which it should be since it can be modified via .Init anyways!), we can just use e.g. msg.Header(&foo.Table) instead of needing the initFB helper.Before:
After: