Merge branch 'assemble-events-bench' into 'main'

Add benchmark for assembleEvents

See merge request soapbox-pub/ditto!316
This commit is contained in:
Alex Gleason 2024-05-25 15:52:10 +00:00
commit 40f72f750e
6 changed files with 55 additions and 3 deletions

32
fixtures/hydrated.jsonl Normal file
View File

@ -0,0 +1,32 @@
{"id":"63d54e69da65af273683e62a8afe35bb125901d6f9c38817f2db38850dcad38f","kind":1,"pubkey":"17538dc2a62769d09443f18c37cbe358fab5bbf981173542aa7c5ff171ed77c4","content":"Fran had beef empanadas for breakfast and came after mandatory algos","created_at":1716651366,"tags":[["e","d14564e5f13e7ea2d090fcb301cfc71e214b2e9348f98dbda18f930e1ee91453","","root"],["p","726a1e261cc6474674e8285e3951b3bb139be9a773d1acf49dc868db861a1c11"]],"sig":"4f592599e9adcf4b4160626ebe06f061ade4309ac683ef8f0fa04bf0514ea3f90171993dd8c755ca419f487ded496cce9d40a7b340cb1ed6ca213da2980f3051"}
{"id":"d72f4995ebadb841e75afa08d28626c7fb275515e5e8cca29842c34018476522","kind":1,"pubkey":"3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24","content":"😂","created_at":1716651307,"tags":[["e","b1ed8ea342d0023a8bedcb79de77633f8f550a21e363e707dd260e411977cff4","","root"],["e","518977b03781fbcf4383cc7fa76f8d3a5326ba687d37d0567db13e7be88e12cb","","reply"],["p","cfe3b4316d905335b6ce056ba0ec230b587a334381e82bf9a02a184f2d068f8d"],["p","3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24"],["p","4b74667f89358cd582ad82b16a2d24d5bfcb89ac4b1347ee80e5674a13ba78b2"]],"sig":"7c535641d7b405c74857dd6beddb639554e8a8e5cb0b61b1e172b3865a69a7208d38e22558693d8630516e54f23171df00055fc8923ab90a5ad22f2f4453a62a"}
{"id":"879784117ef204bacc0fdc7fa306b81e9f76f6793f743639550239074ec28373","kind":1,"pubkey":"3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24","content":"Loves me some fried chicken.","created_at":1716651290,"tags":[["e","b1ed8ea342d0023a8bedcb79de77633f8f550a21e363e707dd260e411977cff4","","root"],["e","b1ed8ea342d0023a8bedcb79de77633f8f550a21e363e707dd260e411977cff4","","root"],["e","262e209395ea847fa4ade5e4370394276ae95cf908fff8d29fb86f8a360c00d2","","reply"],["p","3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24"],["p","af387a6c488c5484088ba715dbb42b55ce72b475e1e2b86be791b24b8d51e215"]],"sig":"dca7b3443d6db6d21eac2a3570f68b8854dc8edd7eb948c4d903569304d9e4865388cd77362ba508dff974d9e684308a454f0f766cdb63ba120e033a3024a9ef"}
{"id":"38c755514d9d7e1d8c8fbfd8ff6d475c97d1fba504e2c90431cd3e3e84c71056","kind":1,"pubkey":"17538dc2a62769d09443f18c37cbe358fab5bbf981173542aa7c5ff171ed77c4","content":"😂👏","created_at":1716651146,"tags":[["e","bd2afa1348221ee72205e77368ad0341f2cedb13150928bf9dadbd7a58d68c5e","","root"],["p","13a9e5d2a683cb4690ffb83f12848adc9c3423e2fcd786e86d35ee25faacbfbd"]],"sig":"0cbb28192f853f879d51f470f7c8a338ae1f759829fd1a88aa1e4b4f166b71b5bacf98f654cf3f9a8e40282b20a21e939b38aa9e445b1c2af535e36658e2149f"}
{"id":"e088a883c95ca15c2ac245512fd9b1307136101ecb98eeea9621cd22d9cce854","kind":1,"pubkey":"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d","content":"Use a combined key with MuSig to publish.\n\nOr just create a new key that all collaborators know, publish from it, then add it to your list of good wiki people and/or defer from your articles to their articles.","created_at":1716650955,"tags":[["p","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52","wss://relay.damus.io/","PABLOF7z"],["e","cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb","wss://relay.damus.io/","root","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"]],"sig":"b316e9fdba6dbbf547ffea4449bf4c2c06ba880da1b05aa8947633748d1b5ddf06e085d9ca728ebff296c123082ad36178728a3ff075c52bead12cba71fbd93c"}
{"id":"c77d684d95f0babf382ccc6d7cf2c01111ad28a6f3892594da1c565d8f42be00","kind":1,"pubkey":"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d","content":"Maybe you should just defer at the same time you're pushing your edit? If you trust the person enough to give them \"write access\" to your wiki you probably already trust their article enough and/or trust that they will merge your edit.","created_at":1716650124,"tags":[["p","d91191e30e00444b942c0e82cad470b32af171764c2275bee0bd99377efd4075","wss://relay.damus.io/","gsovereignty"],["p","266815e0c9210dfa324c6cba3573b14bee49da4209a9456f9484e5106cd408a5","wss://nostr.wine/","hzrd149"],["p","dd664d5e4016433a8cd69f005ae1480804351789b59de5af06276de65633d319","wss://theforest.nostr1.com/","Laeserin"],["p","1bc70a0148b3f316da33fe3c89f23e3e71ac4ff998027ec712b905cd24f6a411","wss://eden.nostr.land/","Karnage"],["p","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52","wss://relay.damus.io/","PABLOF7z"],["e","cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb","wss://relay.damus.io/","root"],["e","1c9ca83dfdc96bd795e0420904bdfeb81d9434aa69c88ce773f0e6e849b8e6cd","","mention"],["e","ad680fadfc4c0a5e5ab62475c5bdb6a55af05fcd2b2ec7b5e340cf03fdc36a1d","wss://relay.damus.io/","reply","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"]],"sig":"7e9f9ac0e763ea5a3a45f1cbbead272396f508f9fa9abd2677123e98ab49f4d4bac9ee28e8f2d812b75ef2eae2277edca2c3e11eb406ec54e6918075bd3f9558"}
{"id":"319b1708200eeea2887981ff4d32a8e8ac0b35ce3b3029936a13a8bd6626b4df","kind":1,"pubkey":"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d","content":"For example: how would I list all your articles now? I can't, because some of them are now hosted in a different pubkey, so for every article of yours I have to make a new request.","created_at":1716649794,"tags":[["p","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52","wss://relay.damus.io/","PABLOF7z"],["p","1b5c7f2f8a8f7e7ea7775879fd02d098db6ec588114521f1a1edfccd635c1fe9","wss://nostr.wine/","Zach"],["e","cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb","wss://140.f7z.io/","root"],["e","742ca34a0b51fa3ccc10ef89ae190b7c25c4ece0f0776554c0ca985705dbdd27","wss://relay.nostr.band/","mention"],["e","aba8036a7de241777a7a5a2c7b015450da795ba0275ed589edf98abda683dca2","wss://relay.damus.io/","mention","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"],["e","3b0b5ba7c23c1af922c89151b947858bf441163857d2c2bcc113570e73ff9303","wss://pyramid.fiatjaf.com/","reply","3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"]],"sig":"449d9a4239dbde9978eb5517143693edcbaa7e437a73283c92b5291d474f55f3311fe6b9dd9438059b50926eec5c289f150bc17e5d102585810bd75e06a0eaa3"}
{"id":"3b0b5ba7c23c1af922c89151b947858bf441163857d2c2bcc113570e73ff9303","kind":1,"pubkey":"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d","content":"More overhead for people writing the articles, much less overhead for people reading and much less complexity in-protocol.","created_at":1716649678,"tags":[["p","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52","wss://relay.damus.io/","PABLOF7z"],["p","1b5c7f2f8a8f7e7ea7775879fd02d098db6ec588114521f1a1edfccd635c1fe9","wss://nostr.wine/","Zach"],["e","cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb","wss://relay.damus.io/","root"],["e","742ca34a0b51fa3ccc10ef89ae190b7c25c4ece0f0776554c0ca985705dbdd27","wss://relay.nostr.band/","mention"],["e","aba8036a7de241777a7a5a2c7b015450da795ba0275ed589edf98abda683dca2","wss://relay.damus.io/","reply","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"]],"sig":"2609ced7c4dc101d00ebfd6dc6c4255f828af1f0d9ffc876543c815c8d24ce5131f61d8bde0fa184aa06ea1c549b3bd3cfc0d579bcbf6caee86794484d903b64"}
{"id":"512992206a039a3079f5e892eb14368e3d29c4609722911e77919c93b7a68b15","kind":6,"pubkey":"c37b6a82a98de368c104bbc6da365571ec5a263b07057d0a3977b4c05afa7e63","content":"{\"pubkey\":\"9be0be0e64d38a29a9cec9a5c8ef5d873c2bfa5362a4b558da5ff69bc3cbb81e\",\"content\":\"nostr protocol allows anyone to change their name and profile picture at any time.\\n\\nNostur will show previous name and profile pic if available\\nhttps://media.utxo.nl/wp-content/uploads/nostr/7/f/7fcfe9ea3eb7dc850828cc6906dd91ca839de2184982954b4479952d85a1d447.webp\",\"id\":\"b8d7eff16cd1ead7c28032f9e36fd4ef2e29682f84e2a89f2fca8c2bec13385d\",\"created_at\":1716645465,\"sig\":\"2bc2a9eeffa50c5b48c388bdbf2c9622aa2cfdf7484625ef859a027f788983bbde481be7b647121a784ebd0417f109da84a2e43e124b028028c8e792787f7588\",\"kind\":1,\"tags\":[[\"imeta\",\"url https://media.utxo.nl/wp-content/uploads/nostr/7/f/7fcfe9ea3eb7dc850828cc6906dd91ca839de2184982954b4479952d85a1d447.webp\",\"dim 314x260\",\"sha256 7fcfe9ea3eb7dc850828cc6906dd91ca839de2184982954b4479952d85a1d447\"],[\"client\",\"Nostur\",\"31990:9be0be0fc079548233231614e4e1efc9f28b0db398011efeecf05fe570e5dd33:1685868693432\"]]}","created_at":1716649603,"tags":[["e","b8d7eff16cd1ead7c28032f9e36fd4ef2e29682f84e2a89f2fca8c2bec13385d","wss://relay.damus.io","mention"],["p","9be0be0e64d38a29a9cec9a5c8ef5d873c2bfa5362a4b558da5ff69bc3cbb81e"]],"sig":"7af3d238027e58504fe515b8cfb087751485235525a8ce46aa6a43728b97f7681d7b7180cc76cfa5f00a57aafba9ed7b20b301bce59943c3d2e6a9bb7f203e91"}
{"id":"ba9b2c033eba0b14108473773d4529c7f2ad5e8f3d3267a90cd161f94b2b948f","kind":1,"pubkey":"c37b6a82a98de368c104bbc6da365571ec5a263b07057d0a3977b4c05afa7e63","content":"this doesnt look good for manchester city, might not be their day","created_at":1716649355,"tags":[["client","Nostur","31990:9be0be0fc079548233231614e4e1efc9f28b0db398011efeecf05fe570e5dd33:1685868693432"]],"sig":"e748efa0c267aee2c58a58f2031ef14abf74eaf104e110902363f26e04aba56e37813ac8d1ab1d02592ee0546a5c5644092f3e74a2e30c236c4de56449731b56"}
{"id":"f331dc1c3985cf76b997dc9fadcb46241ba0ccb9d20159b0a3ca6f77f4316f58","kind":1,"pubkey":"c37b6a82a98de368c104bbc6da365571ec5a263b07057d0a3977b4c05afa7e63","content":"woman on top","created_at":1716649278,"tags":[["e","88fddb8d21d8f1198ce2e0e1b24c6897a06458576ac57f93b901c01eda862b21","","root"],["e","e43414005ac14ee53e83ed06ec6292dca5beef24077bb4b33546e348f1fb84b0","","reply"],["p","45f195cffcb8c9724efc248f0507a2fb65b579dfabe7cd35398598163cab7627"],["client","Nostur","31990:9be0be0fc079548233231614e4e1efc9f28b0db398011efeecf05fe570e5dd33:1685868693432"]],"sig":"fb492636ab58e604b66a53635f56f9b62a9162fae700a5296313f30ddfe3a3eac8c2019b5b09cf58db5b961a36da7cfcfc08a79f98af5b16d592fe5f76af8e58"}
{"id":"21a8f27145674b0664a4b7ccd0d0ff8c36e4ceb7e35db44df1c3df6f0d593aea","kind":1,"pubkey":"3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24","content":"Found some on the shore. https://i.nostr.build/AaRYE.jpg","created_at":1716649252,"tags":[["e","b1ed8ea342d0023a8bedcb79de77633f8f550a21e363e707dd260e411977cff4","","root"],["e","3232c85dcc455e4c323ffc3742a0eb8b4bbe38418b7c430203e694b4416fce50"],["e","6f3f1713f6c82561cd757ba3b2a2233d63f49478f30b90f2eddc71a1a25d49e9","","reply"],["p","cfe3b4316d905335b6ce056ba0ec230b587a334381e82bf9a02a184f2d068f8d"],["p","3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24"],["p","20d29810d6a5f92b045ade02ebbadc9036d741cc686b00415c42b4236fe4ad2f"],["p","7b394902eeadb8370931f1903d00569545e84113fb6a09634664763be232009c"],["r","https://i.nostr.build/AaRYE.jpg"],["imeta","url https://i.nostr.build/AaRYE.jpg","m image/jpeg","alt Verifiable file url","x c86385263058d896c409ec5644a4a993a52d7decac3b7e052901bd42c2f2cb89","size 603150","dim 2040x1536","blurhash #9Gu5ZJ50f=x,@57I=~BV@0LD*$+I:Io=|M|9axa02RkrrbvNwn$oJozWVR*W-WUofWDazxGxaR+,?kDNxw{niSgf+WAWUJBWARPX9%Mw]t6W?spemWWxvRP$$kXNHRPo2","ox 1951abbc1ee6bf76771f70f1fd305775cec89d30cd5a3947d31656d852efa9bd"]],"sig":"206c40361e578f5cec2c7726bfb99812d706df48057e67eb42f76b7bed8c8269a489be324df9b1f925c241757128394fb60eb494733d3c96cf0ac23569f3680c"}
{"id":"b1ed8ea342d0023a8bedcb79de77633f8f550a21e363e707dd260e411977cff4","kind":1,"pubkey":"3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24","content":"nostr:npub1el3mgvtdjpfntdkwq446pmprpdv85v6rs85zh7dq9gvy7tgx37xs2kl27r it's that time of year again. #thighstr https://i.nostr.build/BRGYD.jpg","created_at":1716648863,"tags":[["p","cfe3b4316d905335b6ce056ba0ec230b587a334381e82bf9a02a184f2d068f8d","","mention"],["t","thighstr"],["r","https://i.nostr.build/BRGYD.jpg"],["imeta","url https://i.nostr.build/BRGYD.jpg","m image/jpeg","alt Verifiable file url","x 376255322f1798e621985bbf028c70c346287404535edbab0aee830094b46673","size 82827","dim 768x1020","blurhash _AEfTfJI0:x[Q,${fN00q?=Y9bx^ohRkK-9~-C~AS0I;t7#=_3OF9_WUi^%1=DVXI.Io%3t7NGO@NH$%?Gi_ogNHJBo#%MNHS2aJsl-7$gRPWnI:ozs.adobR%ja%2M|Si","ox bf1c31404466531f3d58331b404f1116bc9e7a12d6cb41012275f3d36cb53f98"]],"sig":"cd1e87d85f0fd257eac1195ee5c565023d81aa4d17f2d6c0ac3538179db9112b215b951555dcc7bec3e317ad93b08a9f7635c32c9f101986231e898f64075108"}
{"id":"c8d97acccc86babc0884216a3962f4c1beddc9ee16d5dac3b72a2acabad0fdfa","kind":6,"pubkey":"7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19","content":"{\"id\":\"cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb\",\"pubkey\":\"fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52\",\"created_at\":1716648312,\"kind\":1,\"tags\":[[\"client\",\"highlighter\",\"31990:73c6bb92440a9344279f7a36aa3de1710c9198b1e9e8a394cd13e0dd5c994c63:1704502265408\"]],\"content\":\"people interested in nostr wiki:\\n\\nthoughts on allowing collaboration on an entry?\\n\",\"sig\":\"eeac1fa0347e3e240d564e04504d2b01900fd90e7eeab94cfd5034777230e3b593569e771ae0ac9077ae705225faa6cd001a8a43a540b69b69240605484e4ae3\"}","created_at":1716648793,"tags":[["e","cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb"],["p","fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52"],["alt","Repost event"]],"sig":"05d131b8bae0756cf54bb961a27a1dc23109c329d2a84e6d826c11ff5f363536e123d7770f26ea88c4f3580b6c1df6e0cd0dea3470b821fd4e23b52da04086ca"}
{"id":"e8fae24ac25cd3d2d5f5a8efc08e5fe9f0f45ddd975e960805d020bb5f2eb119","kind":1,"pubkey":"17538dc2a62769d09443f18c37cbe358fab5bbf981173542aa7c5ff171ed77c4","content":"Voltage is focused on b2b - I am not sure folks use them for a personal node. \n\nThat said managing your own node is a pain in the 🌝.","created_at":1716648296,"tags":[["e","2253e1fed036e0a86eac892477552b8908684fae69696d89275119bb4e5c42c7","","root"],["e","b136b92f53f4b5ac6988755ba8256d227c3b7a7f687c87cfb256932df359cc60","","reply"],["p","49f586188679af2b31e8d62ff153baf767fd0c586939f4142ef65606d236ff75"]],"sig":"f9659da7b43eda0992418d20a219735162bfa81524b4dba4bce42b31aba7ba41d5be84376a98c37d0bca0321f090326896d44b1fbfb964fb3aa5cff667db8d37"}
{"id":"52cfedd86e7693e3533900f6d6d444ee5b64e5d571679f1a1c60ae25c4d1fbf8","kind":1,"pubkey":"9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b","content":"He's here in substack and YouTube RSS form lol","created_at":1716648028,"tags":[["e","514341e9cfd55b9ce955897a0f5dd1bc1b165ea45868cc31824dc945fdaa7841","","root"],["e","37183ef6e232453c05b7b9ffe831a76704f07b4ac123484094707d184dadf569","","reply"],["p","9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b"],["p","95c7f867802a9c7cfb1d2b243be152234864e2cf9f60f467ae32bf1cf05f89fb"]],"sig":"97758c7b494fff1fbc3a2e88618eb8d6510dc93a7d3aef2bb5bdda977c34ef34a16ddeb59aefc95c7f6a94f49c0c41a2edede768409a361db5561f76f55aa9d2"}
{"id":"2a6860b01ac1cb31c081a6cf93d2d83f7bb4a54d669414db61ead5602688a03e","kind":1,"pubkey":"97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322","content":"PSA: DVM feeds on Coracle were broken this week. They may still be broken, but in a different way. I'll continue to refine the latest release this coming week (and make a tutorial for nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qgwwaehxw309ahx7uewd3hkctcpzemhxue69uhhyetvv9ujumt0wd68ytnsw43z7qgnwaehxw309aex2mrp0yhxvdm69e5k7tcpz9mhxue69uhkummnw3ezuamfdejj7qgkwaehxw309ajkgetw9ehx7um5wghxcctwvshszxthwden5te0wfjkccte9ekk7mt0wd68ytnsd9hxktcprpmhxue69uhkummnv3exjan99eshqup0wfjkccteqyw8wumn8ghj7un9d3shjtngd9nksmrfva58getj9e3k7mf0qqsx8zd7vjg70d5na8ek3m8g3lx3ghc8cp5d9sdm4epy0wd4aape6vsavyafj )","created_at":1716647834,"tags":[["p","6389be6491e7b693e9f368ece88fcd145f07c068d2c1bbae4247b9b5ef439d32","wss://relay.damus.io/","NunyaBidness"],["client","Coracle","31990:97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322:1685968093690"]],"sig":"2b7a5c612f74532e73b967f5d3b4cc9950fb5055873dd1893aeadf58b379cd5e743a45ec321cd36cfd1b62f32bd27ebcea93c640963fbab37ede063d3f5b5c43"}
{"id":"b0ca7c5df23236a14fd8949d0b032252fa0090904d36885a314ff16cade03591","kind":1,"pubkey":"9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b","content":"I'll probably just ignore it as best I can lol. Look at a nice tree and a pleasant stream:) \nMaybe take up beekeeping. That sort of thing.","created_at":1716647725,"tags":[["e","386666836de6df61f2104bc7b0552ac8e2c2e841a99d3a70885452df7f0865b0","","root"],["e","49857012475717e98c7713609dc7e4d95b2339d16eba644f95152ad2feb22e3a","","reply"],["p","9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b"],["p","95c7f867802a9c7cfb1d2b243be152234864e2cf9f60f467ae32bf1cf05f89fb"]],"sig":"998c657f78dc112d2b826fed284f78e8059dd65c0e12d55606d3438acd2f2e685f90fca965f0a30018679c82835246a15af0a8faeee262400d9e79bde156771d"}
{"id":"ccb4828a0955d366f3479a7e9374416f089b2692c80e7bb2a52da27834dbaed9","kind":1,"pubkey":"9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b","content":"Think so yeah, there was a few hood ones. But yeah sounds like it","created_at":1716647663,"tags":[["e","5013462f3f82a32c0ed1f749c4e90a9073a263ecf505fe373d0549f9575d0115","","root"],["e","c7df680aa4e977ff5130e5f4f6765d95bd92dbcd0c13cbc00b16d7681bd8de70"],["e","563671b66257ccfab60abbc9ef3be63a92765efdc7efa3032de68fd8daa68eb2","","reply"],["p","9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b"],["p","dd664d5e4016433a8cd69f005ae1480804351789b59de5af06276de65633d319"]],"sig":"379bc8f177b927b11f4d6527967d3d703a90f830f6264fb3c131dbc2f07aa269fb6629263f3b19207dc1952e1e9a064841092d0846ed69ca486af67743e88130"}
{"id":"88fd33948257b3edbe5fe5e597848252968726d998b81126faff0fbd2eed3a07","kind":1,"pubkey":"17538dc2a62769d09443f18c37cbe358fab5bbf981173542aa7c5ff171ed77c4","content":"For whom?","created_at":1716647197,"tags":[["e","2253e1fed036e0a86eac892477552b8908684fae69696d89275119bb4e5c42c7","","root"],["p","49f586188679af2b31e8d62ff153baf767fd0c586939f4142ef65606d236ff75"]],"sig":"685ba60871b169f7b732b3ff9c8f0bcdc7c5294ec1b479729d5bc409b3d51029465f7b330bd8f4ecb7625b4e8fb6fbb8cf472f78a38069899bbd2b590d68fda7"}
{"id":"cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb","kind":1,"pubkey":"fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52","content":"people interested in nostr wiki:\n\nthoughts on allowing collaboration on an entry?\n","created_at":1716648312,"tags":[["client","highlighter","31990:73c6bb92440a9344279f7a36aa3de1710c9198b1e9e8a394cd13e0dd5c994c63:1704502265408"]],"sig":"eeac1fa0347e3e240d564e04504d2b01900fd90e7eeab94cfd5034777230e3b593569e771ae0ac9077ae705225faa6cd001a8a43a540b69b69240605484e4ae3"}
{"id":"b8d7eff16cd1ead7c28032f9e36fd4ef2e29682f84e2a89f2fca8c2bec13385d","kind":1,"pubkey":"9be0be0e64d38a29a9cec9a5c8ef5d873c2bfa5362a4b558da5ff69bc3cbb81e","content":"nostr protocol allows anyone to change their name and profile picture at any time.\n\nNostur will show previous name and profile pic if available\nhttps://media.utxo.nl/wp-content/uploads/nostr/7/f/7fcfe9ea3eb7dc850828cc6906dd91ca839de2184982954b4479952d85a1d447.webp","created_at":1716645465,"tags":[["imeta","url https://media.utxo.nl/wp-content/uploads/nostr/7/f/7fcfe9ea3eb7dc850828cc6906dd91ca839de2184982954b4479952d85a1d447.webp","dim 314x260","sha256 7fcfe9ea3eb7dc850828cc6906dd91ca839de2184982954b4479952d85a1d447"],["client","Nostur","31990:9be0be0fc079548233231614e4e1efc9f28b0db398011efeecf05fe570e5dd33:1685868693432"]],"sig":"2bc2a9eeffa50c5b48c388bdbf2c9622aa2cfdf7484625ef859a027f788983bbde481be7b647121a784ebd0417f109da84a2e43e124b028028c8e792787f7588"}
{"id":"1c9ca83dfdc96bd795e0420904bdfeb81d9434aa69c88ce773f0e6e849b8e6cd","kind":1,"pubkey":"fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52","content":"say I create a document about \"Stalin\" and I add [\"p\", \"<nostr:npub1mygerccwqpzyh9pvp6pv44rskv40zutkfs38t0hqhkvnwlhagp6s3psn5p >\", \"editor\" ]\n\nthis would mean that the most recent version of my version of Stalin is whatever comes back from the REQ { \"#d\": [\"stalin\"], authors: [<my-pubkey>, <nostr:npub1mygerccwqpzyh9pvp6pv44rskv40zutkfs38t0hqhkvnwlhagp6s3psn5p >] }\n","created_at":1716648317,"tags":[["e","cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb","","root"],["p","d91191e30e00444b942c0e82cad470b32af171764c2275bee0bd99377efd4075"],["client","highlighter","31990:73c6bb92440a9344279f7a36aa3de1710c9198b1e9e8a394cd13e0dd5c994c63:1704502265408"]],"sig":"0756b98ad88cc041c9299922a5da43748c15266640924b7f760897e0386cb0fbdde6338e561ad2af2fee6c72051ee6e6254c6abad9aac6f0d2018d9b07f09cda"}
{"id":"9161f8f465fc4b0462995149ceb23d024c885caf66bc9a421f0c0f842325b021","kind":0,"pubkey":"c37b6a82a98de368c104bbc6da365571ec5a263b07057d0a3977b4c05afa7e63","content":"{\"about\":\"#nobridge #noDM #noSTR #noRMIE\\n✉ no.str@aol.com \\n🔐 https://s.id/no-str\\n🔗 https://gleasonator.dev/@Bac0t.my.id\",\"banner\":\"https://pbs.twimg.com/profile_banners/573176539/1697452071/1500x500\",\"lud16\":\"feelingisrael15@walletofsatoshi.com\",\"name\":\"🦖\",\"nip05\":\"_@Bac0t.my.id\",\"picture\":\"https://pbs.twimg.com/profile_images/1788948029283950592/m9PMKCZO_400x400.png\"}","created_at":1716603430,"tags":[],"sig":"8e955263a526522bbd3a60db8522a0d859fd5bb59a0e0bb03a41cdf2f0e5fb4a43048052871a7338a7f198806107bf005e19767a5719e8aa806ba9cd49183ce8"}
{"id":"e50020597a6aebf6b704686206a682121a9612b6294242baa895437752d62010","kind":0,"pubkey":"9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b","content":"{\"name\":\"7fqx\",\"about\":\"𓊝🍀\",\"picture\":\"https://image.nostr.build/f89f134a56d932f91c5b79175c22bc749bace2cf94f7334f8427d24b210cb876.jpg\",\"banner\":\"https://image.nostr.build/c21af2ac126f85f8b1eacdf04ae47df8fcda4f5916e7d27c7f2f0a5f35df3fcc.jpg\",\"lud16\":\"glhf@getalby.com\",\"image\":\"https://image.nostr.build/86b5aee8f3c7bb5293819e7dd9049fcdc2f912d54150b9b24e041eb5b66aef19.jpg\",\"displayName\":\"7fqx\",\"display_name\":\"7fqx\",\"pubkey\":\"9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b\",\"npub\":\"npub1njst6azswskk5gp3ns8r6nr8nj0qg65acu8gaa2u9yz7yszjxs9s6k7fqx\",\"created_at\":1714857730}","created_at":1716498460,"tags":[],"sig":"3920d47a7c6314bafaa24ba876a300c9cf3875c3ac775bc5a4ead1e0643daa7a5f10c49e563d32846e313a82d809a05e7297367d873e746908bf9476df1125c3"}
{"id":"ec6b70dcb1714d8a887e468305af0ef2d002466385f2e875cdd306f750521b0f","kind":0,"pubkey":"17538dc2a62769d09443f18c37cbe358fab5bbf981173542aa7c5ff171ed77c4","content":"{\"website\":\"https://github.com/alltheseas\",\"lud16\":\"elsat@mutiny.plus\",\"display_name\":\"\",\"about\":\"Damus and freedom tech Product Janitor 🧹\",\"picture\":\"https://nostr.build/i/p/nostr.build_7b9579da60a52c32a61cfe48e7b55b9fbd58d389ca29128d6c6851b00bb23d0a.jpg\",\"name\":\"elsat\",\"banner\":\"https://cdn.nostr.build/i/9b853a8461d114ec2c353b7caaab598286406d1ab4e47f9ebffda4db757bdaa5.jpg\",\"reactions\":false}","created_at":1716219324,"tags":[],"sig":"ea0f6c0563fa2bf549f141e6d769d432dae4767d739968814b24f841b4a68cbaf36c848d383453fa2a46d530a08d8c70eb6c9865d941c3ca1ef78057a740f40a"}
{"id":"93e845c76ee32784733bc1dbba5e45270fde733c4207eb5832e5ba30a98f20ca","kind":0,"pubkey":"3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24","content":"{\"created_at\":1707238393,\"picture\":\"https://i.nostr.build/Z7j8.jpg\",\"name\":\"Derek Ross\",\"about\":\"Building NostrPlebs.com and NostrNests.com. The purple pill helps the orange pill go down. Nostr is the social glue that binds all of your apps together.\",\"lud16\":\"pay@derekross.me\",\"display_name\":\"Derek Ross\",\"banner\":\"https://i.nostr.build/O2JE.jpg\",\"website\":\"https://nostrplebs.com\",\"nip05\":\"derekross@nostrplebs.com\"}","created_at":1715808097,"tags":[["alt","User profile for Derek Ross"],["i","twitter:derekmross","1634343988407726081"],["i","github:derekross","3edaf845975fa4500496a15039323fa3"]],"sig":"2862018e2ca23d9a376691a40c306494786148560d28f9799e4137dfa6a2f1bead2d35b21b68fe09837c4e6cf858f5642f38a5d97234e37b1a5e002ca1d37a8e"}
{"id":"0810aed567c2cc7a0caccab17ea51fe30ea71862a71c13516777f9842b1f7532","kind":0,"pubkey":"97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322","content":"{\"picture\":\"https://i.nostr.build/AZ0L.jpg\",\"about\":\"Christian Bitcoiner and developer of the coracle.social nostr client.\\nLearn more at https://coracle.tools\",\"name\":\"hodlbod\",\"nip05\":\"hodlbod@coracle.social\",\"nip05_updated_at\":1676671261,\"banner\":\"https://i.nostr.build/axYJ.jpg\",\"lud16\":\"hodlbod@getalby.com\",\"website\":\"coracle.social\"}","created_at":1714776395,"tags":[["client","Coracle","31990:97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322:1685968093690"]],"sig":"04f515ac035b94b940a6c91f876de1532708d1e4118491fd16519d9fbed096d327aa644bd14008629f7572c405e27abab0865805255a0ea526259c802ad31dcb"}
{"id":"5967d8b638bf20b305eafcbaf4aa2cf317d38696e9e86853cf4e079c1f463f24","kind":0,"pubkey":"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d","content":"{\"name\":\"fiatjaf\",\"about\":\"~\",\"picture\":\"https://fiatjaf.com/static/favicon.jpg\",\"nip05\":\"_@fiatjaf.com\",\"lud06\":\"\",\"lud16\":\"fiatjaf@zbd.gg\"}","created_at":1714591065,"tags":[],"sig":"066666c5f1f4127816e7634165799cb7780634c96539bb75c56183f59d7a3cd54245df4fce696da320256f5c19746389d75206ff127f6f08a0927c444cf8d38f"}
{"id":"22191979d7f21129c97a6740909e53f3df554f39667f7853d087623e5cf1a11d","kind":0,"pubkey":"7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19","content":"{\"name\":\"greenart7c3\",\"nip05\":\"greenart7c3@greenart7c3.com\",\"about\":\"PGP\\n\\n44F0AAEB77F373747E3D5444885822EED3A26A6D\\n\\nDeveloping Amber\\n\\nhttps://github.com/greenart7c3/Amber\",\"lud16\":\"greenart7c3@greenart7c3.com\",\"display_name\":\"greenart7c3\",\"picture\":\"https://pfp.nostr.build/a40c078816657986911bd2ec73cf9db6bd68af60bea6eaddbf14bbce7424feb8.png\",\"website\":\"https://paynym.is/+florallake7D2\"}","created_at":1714136365,"tags":[["alt","User profile for greenart7c3"]],"sig":"ea12a8605e84040a021a6929f5d898aa4537080f10a4e281a5d37bd04b923a02273da1dac1abb14ef39f5588246fab10e631fa9860b49cf459255e00f9324625"}
{"id":"5db62e87cbb8dfdea54e61713a1ea6647bf164aea5a58afd620b220d22e20b22","kind":0,"pubkey":"fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52","content":"{\"banner\":\"https://pablof7z.com/images/banner.jpg\",\"about\":\"Magical Other Stuff Maximalist\",\"name\":\"PABLOF7z\",\"website\":\"https://pablof7z.com\",\"display_name\":\"PABLOF7z\",\"lud16\":\"pablof7z@primal.net\",\"picture\":\"https://pablof7z.com/images/me.jpg\",\"nip05\":\"_@f7z.io\",\"created_at\":1712782129,\"categories\":[]}","created_at":1712947216,"tags":[["c","Business & Entrepreneurship"],["c","Development & Engineering"],["client","highlighter","31990:73c6bb92440a9344279f7a36aa3de1710c9198b1e9e8a394cd13e0dd5c994c63:1704502265408"]],"sig":"99b38ad955ecb1b05fb6488d9890851f2f86603558d6631e0cf32cb0bfaba1bdcc1c33a2f97c5cd46c811d08a04e97b273bd5677eb89f93f22332ad58d01ac34"}
{"id":"f89a514d9d547528e229def6ff869bd9f50963d79a728409c2d43f0207e7ca94","kind":0,"pubkey":"9be0be0e64d38a29a9cec9a5c8ef5d873c2bfa5362a4b558da5ff69bc3cbb81e","content":"{\"name\":\"Fabian\",\"nip05\":\"fabian@nostur.com\",\"picture\":\"https:\\/\\/profilepics.nostur.com\\/profilepic_v1\\/9512c8b31c97ec0ebc8e66b44de8bafef498d335fd542a0aa1400bbc19fec9d5\\/profilepic.jpg?1710414069\",\"lud16\":\"weathereddarkness25@getalby.com\",\"about\":\"https:\\/\\/nostur.com\",\"banner\":\"https:\\/\\/profilepics.nostur.com\\/banner_v1\\/e358d89477e2303af113a2c0023f6e77bd5b73d502cf1dbdb432ec59a25bfc0f\\/banner.jpg?1682440972\"}","created_at":1712841341,"tags":[],"sig":"39a9b80361bcf8c6a13504a694037016ac5570b1f49e339521bd7068c46edf64352179ba797190f1ceeb94c0b6809977b65e2cd7e5bfe1367aa967eb614e93ef"}

1
fixtures/stats.json Normal file
View File

@ -0,0 +1 @@
{"authors":[{"pubkey":"17538dc2a62769d09443f18c37cbe358fab5bbf981173542aa7c5ff171ed77c4","followers_count":1386,"following_count":2108,"notes_count":805},{"pubkey":"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d","followers_count":7420,"following_count":478,"notes_count":446},{"pubkey":"3f770d65d3a764a9c5cb503ae123e62ec7598ad035d836e2a810f3877a745b24","followers_count":6999,"following_count":1428,"notes_count":801},{"pubkey":"7579076d9aff0a4cfdefa7e2045f2486c7e5d8bc63bfc6b45397233e1bbfcb19","followers_count":535,"following_count":962,"notes_count":59},{"pubkey":"97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322","followers_count":4199,"following_count":398,"notes_count":176},{"pubkey":"9be0be0e64d38a29a9cec9a5c8ef5d873c2bfa5362a4b558da5ff69bc3cbb81e","followers_count":695,"following_count":242,"notes_count":49},{"pubkey":"9ca0bd7450742d6a20319c0e3d4c679c9e046a9dc70e8ef55c2905e24052340b","followers_count":614,"following_count":301,"notes_count":566},{"pubkey":"c37b6a82a98de368c104bbc6da365571ec5a263b07057d0a3977b4c05afa7e63","followers_count":270,"following_count":361,"notes_count":589},{"pubkey":"fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52","followers_count":6902,"following_count":1,"notes_count":536}],"events":[{"event_id":"1c9ca83dfdc96bd795e0420904bdfeb81d9434aa69c88ce773f0e6e849b8e6cd","reposts_count":0,"replies_count":0,"reactions_count":3,"reactions":"{\"🔥\":2,\"🤙\":1}"},{"event_id":"2a6860b01ac1cb31c081a6cf93d2d83f7bb4a54d669414db61ead5602688a03e","reposts_count":0,"replies_count":0,"reactions_count":2,"reactions":"{\"🧡\":1,\"+\":1}"},{"event_id":"b1ed8ea342d0023a8bedcb79de77633f8f550a21e363e707dd260e411977cff4","reposts_count":0,"replies_count":0,"reactions_count":4,"reactions":"{\"🔥\":2,\"+\":2}"},{"event_id":"b8d7eff16cd1ead7c28032f9e36fd4ef2e29682f84e2a89f2fca8c2bec13385d","reposts_count":1,"replies_count":0,"reactions_count":4,"reactions":"{\"🤙\":1,\"+\":2,\"👌\":1}"},{"event_id":"cc127dc2528ad97eaa88ff37d6c5d6bbe94b163ca873701db64f9e1bcfaa40cb","reposts_count":2,"replies_count":0,"reactions_count":5,"reactions":"{\"💜\":1,\"🤙\":3,\"+\":1}"},{"event_id":"f331dc1c3985cf76b997dc9fadcb46241ba0ccb9d20159b0a3ca6f77f4316f58","reposts_count":0,"replies_count":0,"reactions_count":1,"reactions":"{\"+\":1}"}]}

View File

@ -0,0 +1,13 @@
import { assembleEvents } from '@/storages/hydrate.ts';
import { jsonlEvents } from '@/test.ts';
const testEvents = await jsonlEvents('fixtures/hydrated.jsonl');
const testStats = JSON.parse(await Deno.readTextFile('fixtures/stats.json'));
// The first 20 events in this file are my home feed.
// The rest are events that would be hydrated by the store.
const events = testEvents.slice(0, 20);
Deno.bench('assembleEvents with home feed', () => {
assembleEvents(events, testEvents, testStats);
});

View File

@ -1,8 +1,8 @@
import { assertEquals } from '@std/assert';
import { hydrateEvents } from '@/storages/hydrate.ts';
import { MockRelay } from '@nostrify/nostrify/test'; import { MockRelay } from '@nostrify/nostrify/test';
import { assertEquals } from '@std/assert';
import { DittoEvent } from '@/interfaces/DittoEvent.ts'; import { DittoEvent } from '@/interfaces/DittoEvent.ts';
import { hydrateEvents } from '@/storages/hydrate.ts';
import { eventFixture } from '@/test.ts'; import { eventFixture } from '@/test.ts';
Deno.test('hydrateEvents(): author --- WITHOUT stats', async () => { Deno.test('hydrateEvents(): author --- WITHOUT stats', async () => {

View File

@ -67,7 +67,7 @@ async function hydrateEvents(opts: HydrateOpts): Promise<DittoEvent[]> {
} }
/** Connect the events in list `b` to the DittoEvent fields in list `a`. */ /** Connect the events in list `b` to the DittoEvent fields in list `a`. */
function assembleEvents( export function assembleEvents(
a: DittoEvent[], a: DittoEvent[],
b: DittoEvent[], b: DittoEvent[],
stats: { authors: DittoTables['author_stats'][]; events: DittoTables['event_stats'][] }, stats: { authors: DittoTables['author_stats'][]; events: DittoTables['event_stats'][] },

View File

@ -16,6 +16,12 @@ export async function eventFixture(name: string): Promise<NostrEvent> {
return structuredClone(result.default); return structuredClone(result.default);
} }
/** Import a JSONL fixture by name in tests. */
export async function jsonlEvents(path: string): Promise<NostrEvent[]> {
const data = await Deno.readTextFile(path);
return data.split('\n').map((line) => JSON.parse(line));
}
/** Generate an event for use in tests. */ /** Generate an event for use in tests. */
export function genEvent(t: Partial<NostrEvent> = {}, sk: Uint8Array = generateSecretKey()): NostrEvent { export function genEvent(t: Partial<NostrEvent> = {}, sk: Uint8Array = generateSecretKey()): NostrEvent {
const event = finalizeEvent({ const event = finalizeEvent({