Giter Club home page Giter Club logo

go-generate-salts's Introduction

Genearting salts for WordPress with go

To deploy

  1. clone repo
  2. install packages with govendor install +local
  3. run it with go run salt.go or compile with go build salt.go and run with ./salt

Once it's running

/ gets you standard snippet that you can drop into your wp-config.php file

/env gets you format that you can drop into your .env file

/json gets you the salts with key-value in JSON format

Benchmark

We're only using the optimised fastest / safest versions of the function calls.

go test -benchmem -bench=.

As of 24th March 2018

$ go test -benchmem -bench=.
goos: darwin
goarch: amd64
pkg: heroku-dotenv
BenchmarkRandStringBytesMaskImpr8x64-4    300000     5199 ns/op   1024 B/op     16 allocs/op
BenchmarkRandStringBytesMaskImpr512-4     300000     4687 ns/op   1024 B/op      2 allocs/op
BenchmarkGenerateSaltsWP512-4             200000     8511 ns/op   4193 B/op     52 allocs/op
BenchmarkGenerateSaltsEnv512-4            200000     6769 ns/op   3249 B/op     28 allocs/op
BenchmarkGenerateSaltsJSON512-4           200000     5150 ns/op   1360 B/op      4 allocs/op
BenchmarkSrcInt63Parallel-4               200000    11216 ns/op   1024 B/op      2 allocs/op
PASS
ok      heroku-dotenv    9.803s

Profiling

  1. run app
  2. siege one of the endpoints continuously (siege -c 250 -t2m -v http://localhost:8090 works nicely)
  3. while siege is running, in another terminal, start the profile: go tool pprof http://localhost:8090
  4. enjoy your data! See https://blog.golang.org/profiling-go-programs for more info on profiling
  5. 48.9% syscall ;)

Thank you!

go-generate-salts's People

Contributors

javorszky avatar djavorszky 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.