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

encoding/json: Add Custom JSON Package with Build Tag Support for Sonic #1623

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

Conversation

shazbert
Copy link
Collaborator

PR Description

This pull request introduces a custom JSON package located in encoding/json/ to facilitate swapping between the default Go encoding/json package and the sonic library based on build tags.

Adds:

  • json.go (default implementation using encoding/json).
  • sonic.go (alternative implementation using sonic library).

Import Updates:

All imports to the standard encoding/json package have been updated to the new custom package github.com/thrasher-corp/gocryptotrader/encoding/json.

Added basic benchmarks for both the default encoding/json and the sonic implementation to evaluate hot-swap performance.

Type of change

Please delete options that are not relevant and add an x in [] as item is complete.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and
also consider improving test coverage whilst working on a certain feature or package.

  • go test ./... -race
  • golangci-lint run
  • Test X

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally and on Github Actions with my changes
  • Any dependent changes have been merged and published in downstream modules

@shazbert shazbert self-assigned this Aug 20, 2024
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 36.51%. Comparing base (cb6b342) to head (2f69362).

Files with missing lines Patch % Lines
cmd/exchange_wrapper_issues/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1623   +/-   ##
=======================================
  Coverage   36.50%   36.51%           
=======================================
  Files         414      414           
  Lines      179353   179353           
=======================================
+ Hits        65477    65487   +10     
+ Misses     106006   106004    -2     
+ Partials     7870     7862    -8     
Files with missing lines Coverage Δ
backtester/btcli/main.go 0.00% <ø> (ø)
backtester/config/backtesterconfig.go 88.46% <ø> (ø)
backtester/config/strategyconfig.go 83.51% <ø> (ø)
backtester/config/strategyconfigbuilder/main.go 0.00% <ø> (ø)
backtester/eventhandlers/statistics/statistics.go 74.63% <ø> (ø)
backtester/main.go 0.00% <ø> (ø)
cmd/apichecker/apicheck.go 38.20% <ø> (+0.15%) ⬆️
cmd/config/config.go 8.62% <ø> (ø)
cmd/config_builder/builder.go 0.00% <ø> (ø)
cmd/documentation/documentation.go 0.00% <ø> (ø)
... and 92 more

... and 8 files with indirect coverage changes

@shazbert shazbert added review me This pull request is ready for review low priority This enhancement or update will be implemented at a later date. and removed blocked labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority This enhancement or update will be implemented at a later date. review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant