8000 GitHub - insomnius/wallet-event-loop: Wallet single thread event loop proof of concept
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

insomnius/wallet-event-loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wallet With Single Threaded Event Loop - Proof of Concept

This proof of concept is intended to show you how single threaded event loop could solve concurrency problem that happen in a online wallet usecases.

Requirements

  • User can be created and have a wallet.
  • User can top up their wallet
  • User can transfer their money from their wallet to another wallet
  • User can see their top 5 incoming and outgoing wallet mutations

Concept

Single Threaded Event Loop

Benchmark

DB package benchmark

Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -bench ^BenchmarkTransaction$ github.com/insomnius/wallet-event-loop/db

goos: linux
goarch: amd64
pkg: github.com/insomnius/wallet-event-loop/db
cpu: 12th Gen Intel(R) Core(TM) i5-12400F
BenchmarkTransaction-12    	   48580	     22459 ns/op	   40989 B/op	     182 allocs/op
PASS
ok  	github.com/insomnius/wallet-event-loop/db	1.345s

Transfer process benchmark

Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -bench ^BenchmarkTransfer$ github.com/insomnius/wallet-event-loop/agregation

goos: linux
goarch: amd64
pkg: github.com/insomnius/wallet-event-loop/agregation
cpu: 12th Gen Intel(R) Core(TM) i5-12400F
BenchmarkTransfer-12    	  296427	      3563 ns/op	   10936 B/op	      31 allocs/op
PASS
ok  	github.com/insomnius/wallet-event-loop/agregation	1.103s

Test Results

Test Results

Checkpoints

007c5a0ada9a3a760e3bdee86bd0c86c5e5a2bb3 -- Single threaded event loop with channel

About

Wallet single thread event loop proof of concept

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0