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

v2 #144

Merged
merged 16 commits into from
Aug 18, 2024
Merged

v2 #144

merged 16 commits into from
Aug 18, 2024

Commits on Aug 18, 2024

  1. Switch to net/netip

    The preformance of this is approximately the same as the net.IP version,
    except for the methods that return a network. For those, there is a
    slight improvement.
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    853e75b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4a5a9d6 View commit details
    Browse the repository at this point in the history
  3. Make Lookup return a Result

    This makes it easier to extend without adding many different lookup methods.
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    b46d987 View commit details
    Browse the repository at this point in the history
  4. Add the ability to decode a single path

    This is more ergonomic than creating a struct for a single value and
    the performance is better as well due to less reflection:
    
    BenchmarkDecodeCountryCodeWithStruct-8   	 1347441	       882.4 ns/op	       1 B/op	       0 allocs/op
    BenchmarkDecodePathCountryCode-8         	 2708011	       445.1 ns/op	       1 B/op	       0 allocs/op
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    8da779a View commit details
    Browse the repository at this point in the history
  5. Disable gocognit linter

    It is somewhat arbitrary, especially when dealing with switch statements
    and code may be inlined for performance reasons.
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    800e54a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3987a4b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0a0e493 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    62022ad View commit details
    Browse the repository at this point in the history
  9. Inline traversal functions

    In order to make it easier to refactor and optimize.
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    9541b71 View commit details
    Browse the repository at this point in the history
  10. Add benchmarks for Networks

    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    3c14af0 View commit details
    Browse the repository at this point in the history
  11. Simplify error handling

    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    21b9508 View commit details
    Browse the repository at this point in the history
  12. Reduce allocations in Networks

    Slice length of 64 is used as most IPv6 trees will have that as their
    maximum depth.
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    13ed83b View commit details
    Browse the repository at this point in the history
  13. Fix lints with new golangci-lint

    The comment on "iter" is because the linter was not stable and kept on
    shifting it every time it ran.
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    a584c61 View commit details
    Browse the repository at this point in the history
  14. Remove (*Reader).Decode

    And replace it with (*Reader).LookupOffset
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    c075ec6 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    791db99 View commit details
    Browse the repository at this point in the history
  16. Rename Network to Prefix

    To more closely match net/netip. Also, it may reduce confusion with
    Networks and NetworksWithin, which refer to more than just the network.
    oschwald committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    cb27d1e View commit details
    Browse the repository at this point in the history