Skip to content

Instantly share code, notes, and snippets.

View ryogrid's full-sized avatar

Ryo Kanbayashi ryogrid

View GitHub Profile
@ryogrid
ryogrid / result_of_unittest_230922_1225.txt
Created September 24, 2023 03:25
result of unittest of Optimizer (Selinger) 230922_1225
=== RUN TestSimplePlanOptimization
System logging is active.
Pattern Name: Simple(SequentialScan)
[ select Sc1.c1 from Sc1 where Sc1.c1 = 2; ]
==================================================
ProjectionPlanNode [sc1.c1, ]
ProjectionPlanNode [sc1.c1, ]
SelectionPlanNode [ colIndex:0 2 = ]
SeqScanPlanNode [sc1.c1, sc1.c2, sc1.c3, ]
@ryogrid
ryogrid / rabbit_indexed_db.json
Created September 30, 2023 08:01
rabbitがIndexedDBに保持していたデータ
This file has been truncated, but you can view the full file.
{
"buster": "",
"timestamp": 1696058788895,
"clientState": {
"mutations": [],
"queries": [
{
"state": {
"data": {
"content": {
@ryogrid
ryogrid / parallel_txn_insert_after_select_cpu_prof.txt
Last active October 13, 2023 10:43
10万エントリを並列にINSERTして、その後、その中からランダムに並列にSELECTした時のcpu profile
(pprof) top200
Showing nodes accounting for 130.23s, 82.06% of 158.71s total
Dropped 688 nodes (cum <= 0.79s)
flat flat% sum% cum cum%
16.15s 10.18% 10.18% 16.17s 10.19% runtime.stdcall2
13s 8.19% 18.37% 13s 8.19% runtime._ExternalCode
5.61s 3.53% 21.90% 20.12s 12.68% runtime.mallocgc
4.54s 2.86% 24.76% 20.85s 13.14% runtime.scanobject
4.08s 2.57% 27.33% 4.09s 2.58% runtime.stdcall1
3.79s 2.39% 29.72% 8.55s 5.39% runtime.findObject
@ryogrid
ryogrid / README.md
Last active October 24, 2023 05:56
simple parallel query throughuput benchmarking of SQLite3 with Go and go-sqlite3 lib

simple benchmarking SQLite3 with Go and go-sqlite3 lib

licence of materials on this gist are MIT license
Copylight 2023 Ryo Kanbayashi

@ryogrid
ryogrid / query_jsons.txt
Last active October 28, 2023 01:13
SamehadaDB REST I/F sample request jsons
{"Query":"CREATE TABLE name_age_list(name VARCHAR(256), age INT);"}
{"Query":"INSERT INTO name_age_list(name, age) VALUES ('Sam', 20);"}
{"Query":"INSERT INTO name_age_list(name, age) VALUES ('Bob', 22);"}
{"Query":"INSERT INTO name_age_list(name, age) VALUES ('Alice', 25);"}
{"Query":"INSERT INTO name_age_list(name, age) VALUES ('Kathy', 18);"}
{"Query":"INSERT INTO name_age_list(name, age) VALUES ('Andy', 18);"}
{"Query":"DELETE FROM name_age_list WHERE age > 20;"}
{"Query":"SELECT * FROM name_age_list;"}
// below is result of last SELECT query. results of other queries are omitted here
@ryogrid
ryogrid / gossip-overlay-todo.txt
Last active February 10, 2024 10:23
gossipプロトコルベースのオーバレイネットワーク構築ライブラリ Gossip Overlayの実装TODO
■meshとpion/sctpとpion/datachannelを使ったオーバレイネットワーク構築用ライブラリ Gossip Overlayの開発
・【済】read済みのデータをバッファから取り除く
・【済】ローカルのバッファを触る時はconnオブジェクトのmutexのロックをとって行うようにする
・【済】複数のノードとやりとりしても問題ないようにする(meshライブラリのユニキャストを使う時の話)
・【済】meshのオリジナルをimportする形(修正無し)で動作に問題ないか確認する
・【済】password を nil にしなかった場合に暗号化がなされるのか、なされるならどの範囲までか、を確認
 => 同一のpasswordを設定しているノードしか同一のネットワークには参加できない模様。中継も含めて、
   おそらく・・・ノード間の通信は暗号化されている
・【済】新たなデータを受信するまでreadがブロックするようにする(プロキシデーモンの形にする時に必要、と思われる)
・【作業中】ノード間ごとの通信路(conn?)を双方向通信可なチャネルとして抽象化する(コネクションの概念を導入する)
@ryogrid
ryogrid / BallController.cs
Created November 16, 2023 23:41
Unityで作った3D版Pongのソースコード部分だけ (https://unityroom.com/games/3dpongmodoki)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BallController : MonoBehaviour
{
public GameObject StampPrefab;
public GameObject ParticlePrefab;
private Rigidbody rb;
@ryogrid
ryogrid / lmdb-survey.md
Last active December 23, 2023 01:54
Survey of internel design of Lightning Memory-Mapped Database (LMDB) and its usage on real applications (Nostr relays)

Introduction

  • This is article about knowledges I got with survey of LMDB a DBMS

Discraimer

  • The author is not an expert on database systems, so there is a possibility that my descriptions are sloppy. Please keep this in mind. I would appreciate it if you could point out any mistakes
  • Some of the content is based on speculation. I write in a way that makes it clear that these parts are based on speculation
    • (Because I couldn't go as far as checking the implementation)

Why I decided to survey about LMDB

  • There is a communication protocol architecture for distributed applications called nostr
@ryogrid
ryogrid / config.js
Created December 24, 2023 05:51
config of Bostr
// Bostr config
module.exports = {
// Server listener [Required]
address: "127.0.0.1",
port: "8080",
// Clusters.
// 0 will make bostr run clusters with available parallelism / CPU cores.
@ryogrid
ryogrid / config.js
Last active September 5, 2024 13:56
current bostr config
// Bostr config
module.exports = {
// Server listener [Required]
address: "127.0.0.1",
port: "8080",
// Clusters.
// 0 will make bostr run clusters with available parallelism / CPU cores.
clusters: 1,