GithubHelp home page GithubHelp logo

blueicesir / go-extend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thinkeridea/go-extend

0.0 1.0 0.0 177 KB

go语言扩展包,收集一些常用的操作函数,辅助更快的完成开发工作,并减少重复代码

Home Page: https://pkg.go.dev/github.com/thinkeridea/go-extend

License: MIT License

Go 100.00%

go-extend's Introduction

go-extend

GoDoc Actions Status codecov Go Report Card GitHub release

go-extend 收集一些常用的操作函数,辅助更快的完成开发工作,并减少重复代码。

它收集各种杂项函数,并进行归类,方便使用者查找,它可以大幅度提升开发效率和程序运行性能。它以保证性能为最大前提,提供有效的方法。 针对一些标准库中的函数或者库进行一些修改,使其性能大幅度提升,但它并不用来替换标准库函数,这些函数往往会在一些场景下有效,但有些函数可以用来替换标准库函数,它们保持一致的功能,且相当安全。

一些包或者函数使用示例及分析可以在我的 博客(https://blog.thinkeridea.com) 中找到。

安装

$ go get  github.com/thinkeridea/go-extend/...

规范:

  • 与标准库包名一致的使用 ex 前缀, 避免与标准库包冲突
  • 包目录下 doc.go 作为包说明文档

性能测试

包中一些函数会进行性能测试,包括每次修订的性能对比,它们一般位于各自包下面的 benchmark 目录下,性能测试结果可以在 benchmark.md 快速浏览。

标准库函数改进列表

用来替换标准库的函数,它们和标准库函数功能保持一致,并拥有更好的性能:

  • exstrings.Join 该方法是对标准库 strings.Join 修改,配合 unsafe 包能有效减少内存分配
  • exstrings.Repeat 该方法是对标准库 strings.Repeat 修改,对于创建大字符串能有效减少内存分配
  • exstrings.Replace 替换字符串 该方法是对标准库 strings.Replace 修改,配合 unsafe 包能有效减少内存分配

用该改善标准库的函数,它们基本和标准库功能一致,但是它们都拥有更好的性能:

许可

go-extend 根据 MIT License 许可证授权,有关完整许可证文本,请参阅 LICENSE

go-extend's People

Contributors

thinkeridea avatar awesee avatar

Watchers

James Cloos avatar

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.