GithubHelp home page GithubHelp logo

cvilsmeier / sqlite-cgo-no-cgo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from multiprocessio/sqlite-cgo-no-cgo

0.0 0.0 0.0 268 KB

Benchmarking mattn/go-sqlite3 vs modernc.org/sqlite vs cvilsmeier/sqinn-go

Go 100.00%

sqlite-cgo-no-cgo's Introduction

SQLite: CGO vs no CGO

This repo benchmarks mattn/go-sqlite3 against modernc.org/sqlite which is a translation of SQLite3 from C to Go. This translation allows the latter package to avoid CGO since there is no C.

My initial observations showed it being twice as slow as mattn/go-sqlite3 and this repo is to test that observation.

See the blog post for details.

Fork

This fork differs from the original in the following aspects:

  • After querying database rows, iterate over it (scan them). Why? Because without iterating, values might not be fetched from the database.

  • Add benchmark for https://github.com/cvilsmeier/sqinn-go

Machine Specs

  • OS: x86_64 GNU/Linux (Debian 11.5)
  • RAM: 16 GB
  • Disk: 1TB NVME SSD
  • Processor: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

Results

10000 rows:

                  cgo             nocgo           sqinn-go
INSERT            0.033           0.060           0.019
GROUP_BY          0.002           0.003           0.006

479827 rows:

                  cgo             nocgo           sqinn-go
INSERT            1.669           2.851           0.840
GROUP_BY          0.187           0.202           0.230

4798270 rows:

                  cgo             nocgo           sqinn-go
INSERT            16.938          28.609           8.504
GROUP_BY           3.620           3.630           2.153

Summary

For small database workloads, the library you're using does not matter so much. For medium to large database workloads however, you'll be better off with cvilsmeier/sqinn-go.

sqlite-cgo-no-cgo's People

Contributors

eatonphil avatar cvilsmeier 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.