-
- Postgres benchmarking.
- WSL2 ubuntu 20.04.
- sudo apt install postgresql postgresql-contrib
- sudo service postgresql start
- sudo -u postgres psql
- alter user postgres password ‘admin’;
- Downloaded windows installer for pgadmin4 (best pg gui) on host.
- Can write scripts, view data, run sql, open psql, whatever.
- Handles connection nicely, localhost:5432 forwarded by default over wsl.
- create table data (id serial, name text, code varchar(4));
- Create 10M rows: insert into data (name, code) select md5(random()::text), left(md5(i::text), 4) from generate_series(1, 10000000) s(i);
- \timing on (or EXPLAIN ANALYZE)
- select * from data where code = ‘6cdd’;
- 730.14MB table and that raw query taking ~300ms.
- create index idx_code on data(code);
- That index took 214.53MB and reduced the query to <1ms.
- Never realized Redis stood for Remote Dictionary Server.
- Remember key-value stores are basically gigantic hashmaps, so you’re already doing efficient lookups rather than unindexed sequential scans.
- Looked a little further into writing a whatsapp bot but decided not to pursue (for now). I have other more important tasks at the moment. https://developers.facebook.com/docs/whatsapp/cloud-api/get-started
- 1 in 6 american households is behind on their utility bills right now.
- 24hr forex volume in 2019 was 6.6T. Now it’s probably over 7T every day. Insane.
- Every minute, nearly 1000 hours of media are uploaded to youtube? Wow.
- Remember modular chains (different sets of validators for consensus, settlement, execution, data availability) vs monolithic chains (same validators do it all). Modular can farm out to L2s, of course.
- Created a very basic browser extension to refresh the process.
- https://gitlab.com/bmahlstedt/simple-extension
- chrome://extensions, developer mode, load unpacked (direct manifest).
- Define permissions.
- Then just load whatever html you want in the extension popup and run whatever js you want (in this case, just fetch the site title and show it in the ext popup).
- Can run in the background, can run when you click on it, can run when you interact with the popup, whatever. Obviously can access a ton – only use trusted extensions.