Code Monkey home page Code Monkey logo

go-tutorial's Introduction

Go tutorial

A collection of Go tutorials for myself.

Result

  • 2021-09-30: I used WSL2 to run.

    โ†’ go1.17.1 test -bench=.
    goos: linux
    goarch: amd64
    pkg: go-tutorial/cmd/cache
    cpu: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
    BenchmarkWriteMemcache-4                      10         100472420 ns/op
    BenchmarkReadMemcache-4                       10         100689330 ns/op
    BenchmarkWriteMemcacheGoroutine-4         652153              4958 ns/op
    BenchmarkReadMemcacheGoroutine-4         1000000              3686 ns/op
    BenchmarkWriteRedis-4                       1652            683277 ns/op
    BenchmarkReadRedis-4                        1827            746675 ns/op
    BenchmarkWriteKeyDb-4                       1678            716956 ns/op
    BenchmarkReadKeyDb-4                        1707            702617 ns/op
    BenchmarkWriteGoCache-4                   548565              3070 ns/op
    BenchmarkReadGoCache-4                  15934350                71.62 ns/op
    BenchmarkWriteGoCacheGoroutine-4         1000000              4790 ns/op
    BenchmarkReadGoCacheGoRoutine-4          3935263               313.0 ns/op
    BenchmarkWriteRistretto-4                    732           1880123 ns/op
    BenchmarkReadRistretto-4                     100          18708744 ns/op
    BenchmarkWriteBigcache-4                       1        4617171600 ns/op
    BenchmarkReadBigcache-4                 11408173               104.6 ns/op
    PASS
    ok      go-tutorial/cmd/cache   50.058s
    goos: linux
    goarch: amd64
    pkg: go-tutorial/cmd/litedb
    cpu: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
    BenchmarkWriteSQLite-4                               151           7949415 ns/op
    BenchmarkReadSQLite-4                               8212            137751 ns/op
    BenchmarkWriteShareMemSQLite-4                       135           7731625 ns/op
    BenchmarkReadShareMemSQLite-4                       8472            137281 ns/op
    BenchmarkWriteShareMemSQLiteGoroutine-4           133040              8507 ns/op
    BenchmarkReadShareMemSQLiteGoroutine-4           1000000              8075 ns/op
    BenchmarkWriteMemSQLite-4                         141237              8991 ns/op
    BenchmarkReadMemSQLite-4                            3776            593021 ns/op
    BenchmarkWriteRQLite-4                               151           6873940 ns/op
    BenchmarkReadRQLite-4                                193           6421101 ns/op
    BenchmarkWriteRQLiteGoroutine-4                   774082            131756 ns/op
    BenchmarkReadRQLiteGoroutine-4                    799147             58185 ns/op
    PASS
    ok      go-tutorial/cmd/litedb  17.752s

Known issues

  1. Some cache tests cannot run with Goroutine:
    • Connection timeout:Redis, KeyDB
    • Run too long: Ristretto, Bigcache.

go-tutorial's People

Contributors

ducminhgd avatar

Watchers

James Cloos avatar  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.