Coder Social home page Coder Social logo

deepcopy's Introduction

DeepCopy

example workflow codecov


Deep copy most of the golang types except unsafe.Pointer and chan with good performance

Usage

var a string = "a"
var b string
err := deepcopy.DeepCopy(&a, &b)
if err != nil {
}

Performance

goos: linux
goarch: amd64
pkg: github.com/wangsquirrel/deepcopy
cpu: AMD Ryzen 7 2700 Eight-Core Processor          
Benchmark_Copy-16                 399337              2790 ns/op            1176 B/op         23 allocs/op
Benchmark_SonicCopy-16            134254              8994 ns/op            8386 B/op         30 allocs/op
Benchmark_GOBCopy-16                8893            134633 ns/op           31186 B/op        689 allocs/op
Benchmark_ReflectCopy-16           78482             15120 ns/op            3576 B/op        145 allocs/op
Benchmark_JsonCopy-16              29007             40924 ns/op            4326 B/op        118 allocs/op
Benchmark_CPYCopy-16               81296             14695 ns/op            2952 B/op         43 allocs/op
Benchmark_RawCopy-16             2407807               500.7 ns/op           272 B/op         16 allocs/op
PASS
ok      github.com/wangsquirrel/deepcopy        10.555s

deepcopy's People

Contributors

wangsquirrel avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

baozixiaoxixi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.