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

Add optimizations to encoder and decoder #387

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

pboyd04
Copy link

@pboyd04 pboyd04 commented Aug 19, 2024

Add optimizations to encoder and decoder to reduce allocations and increase speed

Copy link
Member

@guelfey guelfey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your initiative, but this won't be merged without some larger changes / issues:

  • For the actual performance improvements, please provide benchmarks and comparisons using benchstat
  • You're combining lots of changes which are not strictly related into one single PR (e.g. changing the linting config and fixing the resulting issues). These might be valid, but should be discussed and merged separately to make review easier. Right now this is too big to review sensibly - for that reason, I only briefly scanned the PR and combined other issues I could spot easily that prevent merging.

@@ -44,6 +43,7 @@ func (e InvalidTypeError) Error() string {
// their elements don't match.
func Store(src []interface{}, dest ...interface{}) error {
if len(src) != len(dest) {
fmt.Printf("%#v %#v\n", src, dest)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover debugging print

@@ -1,5 +1,5 @@
module github.com/godbus/dbus/v5
module github.com/pboyd04/dbus/v5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed module path

"testing"
)

/* This seems to be broken. Commenting out for now.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not just comment out tests. This test passes locally on my machine and in CI; it of course depends on having D-Bus installed. If it doesn't pass for some reason on your machine, please open a separate issue.

if err != nil {
t.Fatal(err)
}
expected := [][]byte{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these binary outputs should be moved to testdata files that are read during test runtime

@pboyd04
Copy link
Author

pboyd04 commented Sep 30, 2024

Ok I will do this a bit more piecemeal. Here is the first of the new pulls only doing test changes so that all Benchmarks and tests are apples to apples. #394

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

Successfully merging this pull request may close these issues.

2 participants