Skip to content
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

Any ideas on changing API interface for a major semver update? #742

Open
2 tasks
lance6716 opened this issue Nov 26, 2022 · 3 comments
Open
2 tasks

Any ideas on changing API interface for a major semver update? #742

lance6716 opened this issue Nov 26, 2022 · 3 comments

Comments

@lance6716
Copy link
Collaborator

lance6716 commented Nov 26, 2022

This package is planned do a major semver update and we've got a chance to change public functions, interfaces, etc. To make full use of this update we developers can list our expected changes in this issue, maintainers will check all changes before finally do a update. Hope the package will be better after discussing and accepting contributions with our ideas.

I simply propose some rules on how to use this issue and welcome to comment on both rules and ideas:

  • the deadline of posting expected changes is 3 weeks later, which is Dec-17-2022
  • everyone can comment in this issue or open another issue and link this one, I will edit the description of this issue to make a summary
  • no other one will make sure they would implement your idea! You should do it yourself if you really want it

@lance6716
Copy link
Collaborator Author

I randomly pick up some developers from recent PR, ptal @atercattus @BLAZZ @GMHDBJD @mcuelenaere @tech-sumit @skoef @shizhx @btoonk @nisainan @bingoohuang

You can turn off notification by click "Unsubscribe" button, sorry to bother you :P

@mcuelenaere
Copy link
Contributor

One piece of feedback I have, is that go-mysql-org/go-mysql is allocating lots of memory (which gets freed very soon afterwards), when reading binlogs. In our production app, over 62% of all allocations (average of 1000 profiles taken in the last week) and 73% of all allocated memory are coming from BinlogParser.Parse.

Screenshot 2022-11-26 at 13 03 17

Maybe having some kind of reusable pool of BinlogEvent/RowsEvent objects could help here, but that would require the interface to change as the consumer has to explicitly release these events after being done using them.

Also, more specifically for our usecase, it seems that quite a bit of those allocations are spent on JSON decoding, while actually we are not doing anything with those JSON objects. Maybe having an option to leave the raw JSON []byte as-is could help here.

@lance6716
Copy link
Collaborator Author

lance6716 commented Nov 27, 2022

@mcuelenaere

we encountered a similar problem and came up with a solution, I guess we can also solve your unneeded JSON parsing issue in this way
Our problem is we are only interested in a part of tables in binlog, don't want to waste time parsing uninterested tables, so we add a function injection configuration to let user implement their customized parsing function, like skipping parsing tables based on table name.

#737

so maybe you can use a customized function to only skip JSON columns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants