2
0
Fork 0
mirror of https://github.com/ii64/sonic.git synced 2026-06-21 00:46:43 +08:00

change push-check-arm.yml and remove fall back logics (#284)

* change push-check-arm.yml and remove fall back logics

* fix README on the requirement and compatibility

* fix: README on the requirement and compatibility

* fix: README add backquotes

* fix:remove instruction set requirement in README

* Update README.md

Co-authored-by: Yi Duan <duanyi.aster@bytedance.com>
This commit is contained in:
cyn6315 2022-08-18 15:58:07 +08:00 committed by GitHub
parent a8311c6cde
commit d1190d6797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 6 deletions

View file

@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
go-version: [1.15.x, 1.19.x]
os: [arm, macos-latest]
os: [arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
@ -25,4 +25,6 @@ jobs:
${{ runner.os }}-go-
- name: Compatibility Test
run: go test -v -gcflags=-d=checkptr=0 .
run: |
GOARCH=amd64 go test -gcflags=-d=checkptr=0 -c .
qemu-x86_64 -cpu max ./sonic.test -test.v

View file

@ -5,7 +5,7 @@ A blazingly fast JSON serializing &amp; deserializing library, accelerated by JI
## Requirement
- Go 1.15/1.16/1.17/1.18/1.19
- Linux/MacOS/Windows
- Amd64 CPU with AVX instruction set
- Amd64 ARCH
## Features
- Runtime object binding without code generation
@ -261,7 +261,12 @@ println(string(buf) == string(exp)) // true
- modification: `Set()`, `SetByIndex()`, `Add()`
## Compatibility
Sonic **DOSE NOT** ensure to support all environments, due to the difficulty of developing high-performance codes. For developers who use sonic to build their applications in different environments (ex: developing on M1 Mac but running on Linux server), or those who want to handle JSON strictly consistent with `encoding/json`, we provide some compatible APIs as `sonic.API`
Sonic **DOSE NOT** ensure to support all environments, due to the difficulty of developing high-performance codes. For developers who use sonic to build their applications in different environments, we have the following suggestions:
- Developing on **Mac M1**: Make sure you have Rosetta 2 installed on your machine, and set `GOARCH=amd64` when building your application. Rosetta 2 can automatically translate x86 binaries to arm64 binaries and run x86 applications on Mac M1.
- Developing on **Linux arm64**: You can install qemu and use the `qemu-x86_64 -cpu max` command to convert x86 binaries to amr64 binaries for applications built with sonic. The qemu can achieve similar transfer effect to Rosetta 2 on Mac M1.
For developers who want to use sonic on Linux arm64 without qemu, or those who want to handle JSON strictly consistent with `encoding/json`, we provide some compatible APIs as `sonic.API`
- `ConfigDefault`: the sonic's default config (`EscapeHTML=false`,`SortKeys=false`...) to run on sonic-supporting environment. It will fall back to `encoding/json` with the corresponding config, and some options like `SortKeys=false` will be invalid.
- `ConfigStd`: the std-compatible config (`EscapeHTML=true`,`SortKeys=true`...) to run on sonic-supporting environment. It will fall back to `encoding/json`.
- `ConfigFastest`: the fastest config (`NoQuoteTextMarshaler=true`) to run on sonic-supporting environment. It will fall back to `encoding/json` with corresponding config, and some options will be invalid.
@ -325,4 +330,4 @@ Why? Because `ast.Node` stores its children using `array`:
**CAUTION:** `ast.Node` **DOESN'T** ensure concurrent security directly, due to its **lazy-load** design. However, your can call `Node.Load()`/`Node.LoadAll()` to achieve that, which may bring performance reduction while it still works faster than converting to `map` or `interface{}`
## Community
Sonic is a subproject of [CloudWeGo](https://www.cloudwego.io/). We are committed to building a cloud native ecosystem.
Sonic is a subproject of [CloudWeGo](https://www.cloudwego.io/). We are committed to building a cloud native ecosystem.

View file

@ -1,4 +1,4 @@
// +build !amd64
// +build !amd64,!darwin
/*
* Copyright 2021 ByteDance Inc.