Diary · Page 4

October 5, 2024

Body still hurts! Did I train this well? I thought I was slacking off.

Dad called me today and asked me if I want to visit them and I agreed. It’s been more than a month since my last time.

He picked me up and on the way we went to supermarket and bought tasty treats. █████████████████████████████████

███████████████████████████████████████████████████ I’ve had some really nice chats with dad. ███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████

Dad keeps working, even though he’s kinda suffering from some health issues. We want him to go get checked but he wants to finish some work before doing it, and he’ll need to leave home for about 10 days for it, and after that hopefully he’ll be able to do it.

Fixed some bugs in uExpress and uWS and posted about uWS publicly. Switched Nekoweb to use uWS and all of my other sites and services. YeahServer was on average using 4% CPU and it went down to 1.5% after switch to uExpress, and that’s actually super cool.

Played Yume 2kki, we went through a pretty long expedition, which required a pretty clever 'hack’. The path required Drum to pass, but at the same time required you to not have it. Apparently if you make Drum your Favorite effect, you can equip it even after you remove it in trophy room. This allowed us to pass and get to the destination - Floating Brain World. It has another puzzle that requires some weird shenanigans, and that would unlock way to apparently the deepest world of Yume 2kki. But we stopped here as it’d require quite a lot of time and we got tired already.

Tags: #out #yume2kki

October 4, 2024

Wow, my body actually hurts after gym. I thought at gym that I didn’t really do that much so nothing will hurt, but nope! That’s a good sign.

Continued coding UltimateWS today. Well, I finished it. To implement createWebSocketStream I literally copy-pasted file from ws repo and it worked. That’s even more satisfying than when external things that rely on your library start to work, since usually internal implementation is very different.

Since both UltimateExpress and UltimateWS are done, I was finally able to migrate my website fully to use these libraries! It was annoying, boring and tedious. It’s genuinely crazy how large and complex my website is, and it has such a ton of actual tech debt. In a fucking personal website.

And what’s crazy is that uWS worked almost off first try with my chat and Grillbys. The only thing that needed to be fixed is a check for isBuffer. Migrating to uExpress revealed another bug in it, with trailing slashes, and it has been also successfully squashed.

Now I’m finally free from coding these things… probably… there’s almost definitely gonna be a lot of bugs I’ll need to fix, but it’s better than having to actively code it. I’ll continue switching my projects to my libraries.

It’s really cool to think that you’re actually using your own HTTP and WS servers. Well, ofc the real magic is in uWS, but still, it’s a lot of work to make it all work nicely.

Tags: #code

October 3, 2024

We finally went to gym, for real this time!

Before going inside, I looked around the parking lot and realized that gym is at the edge of the city. Dense city simply ends and suddenly it’s just endless fields… Which I find so dear and which keep calling me to come to them.

█████████████████████████████████████████████████████████████████████████████████████

But I had to resist and we had to finally get inside. We got a free training with personal trainer for the first visit, so he showed us around and told us about some gym things and showed us how to use them. In general, I wanted to go to gym simply because I’m very sedantary and not super fit. I’m not really interested in big muscles and stuff, I just want to start moving more and burn some belly fat.

After doing some muscle training with trainer, we went on a treadmill. When you hold onto it’s iron things, it measures your heartbeat and it was already 130bpm for me, while 90bpm for my brother, which made me quite worried. During most intense running it went up to 170bpm, even though I wasn’t even running 🫣

I googled what’s a good heart rate during running and it said that 170 bpm is already upper limit and that’s usually during running. I think this just indicates how terribly sedantary I am if not even running made my heart rate so high, which is actually scary. Hopefully it’ll improve over time.

After we were done with gym I got another look at the fields and the road going out from city started glowing beautifully.

1000018634.jpg

1000018635.jpg

Brother started driving me home but proposed to maybe go somewhere to eat, but he needed to pick up his girlfriend. He persuaded me to have a dinner with them. It was a tiny bit awkward, since it’s the largest amount of time I ever spent with her around. But the food was nice. We ordered a pizza for everyone (and it was one of the best, or maybe the best pizza I ever had), I got tom yang, they got carbonara and bolognese.

1000018641.jpg

1000018642.jpg

1000018649.jpg

After that I got driven home, and coded a ton of UltimateWS. It’s actually like 65% done now.

October 2, 2024

It was sunny but at the same cold today. I had my first university online class today, but it was quite chill. After class I decided to finally socialize and went to some student event thingy. As I came there I got a color that split me into one of three teams. We played a bunch of team games, and I left a little early because brother came to pick me to go to gym. In general, it was mid… Idk, it’s not like I had a terrible time there, but at same time I felt like I’m just wasting my time playing kinda stupid games instead of being productive, and so many people around was tiring.

When my brother came to pick me up, quite late (at 8 PM), I told him that I was kinda confused because he said we wouldn’t go to gym but apparently he mistype and wanted to only say that about pool. But regardless, since he came he drove there. And then I realized I don’t have a bracelet that allows to go through… And coming back home to get it would take too long for it to worth to go there again. This is like third time we weren’t able to go there somehow. Hopefully next time will be finally successful lol. ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ Felt quite disappointing.

Tags: #out

October 1, 2024

Went outside to withdraw money. Stood outside for a while to enjoy the rain, and met tailless cat again. Might be a good sign.

1000018579.jpg

I figured out how to optimize IPs! Now I only read IP when it’s required and if any request ever reads it after response was sent I start reading it always. This way only 1 request at most would be lost. To minimize that from happening I also made it always read IP for first 100 requests.

Before:

1000018586.png

After:

1000018587.png

Now the difference is really small, HyperExpress is genuinely basically useless now, lol.

Brother came over and we finally decided to go to gym… but it was crowded and shitty again… so we decided to go to more expensive gym afterall, because we both got another discount, but as we came there again it was again kinda scam shit with tiny text saying it cant be used for what we wanted lol. But we still had previous discount and we decided to go with this one after all… It’s just like 10 times better and also had a pool. They took so long at registering us that it was already too late to go actually do anything so we ate and went home. I hope it won’t be a waste of money.

At the end of the day found another optimization opportunity of not creating Socket needlessly, which added another +5k.

September 30, 2024

I have no idea what did I do for the first half of the day.

Played more Yume 2kki. The slide is so fun :3

1000018573.gif

Continued optimizing uExpress. Apparently tseep is quite slow on initialization, so I switched Socket to use built-in event emitter, since there’s a ton of these being created. For long-running stuff it continues to be used. About 2k improvement.

Then I tried removing random parts from code to see for possible slow things and noticed that reading IP is literally 15k req/sec slower! I have no idea why, but res.getRemoteAddressAsText is super slow. I switched it to res.getRemoteAddress and made parsing it lazy and that improved speed by 5k. I really, really wanted to get that last 10k by somehow lazily reading IP but it seems quite literally impossible sadly.

Before:

1000018571.png

After:

1000018572.png

As I went to bed I got email that tests failed, and apparently they just hanged for 45 minutes, but I already published it to npm… Had to make Shy fix it for me while I’m in bed. Thankfully he did it and now I can rest.

September 29, 2024

Woke up and UltimateExpress got some more attention while I was asleep. Someone asked me to add a table with comparison to other frameworks, and gave me link to bun-http-framework-benchmark.

I started setting it up to add UExpress, and noticed that in pull requests there was already PR to add it! But… it had ETag enabled and needlessly set middleware to all routes… With that awful code config, UExpress was performing absolutely terrible, so I made a comment telling what to change.

But performance was still quite bad even with these changes, so I started to look what could be improved. Benchmark itself consists of 3 tests:

  • ping (just a simple response)
  • params + query
  • post with json body

I’ve decided to check Elysia.js codefor possible speed improvements I could do, and apparently they use fast-queryparser library. Unfortunately, it doesn’t support array queries like qs does, but I could work around that by checking if string includes [ or . characters, and speed increased by a considerable amount.

Then I started to look at what could be done with params, and I realized that routes with params can actually be optimized the same way other routes are! But ofc the problem here wasn’t in routing itself, but in parsing of params. At the moment it was using regex for that. I implemented optimization of param routes, and with that I could use uWS native param parser, so I could skip parsing routes with params. Another quite large speed improvement.

After these changes, params+query test basically matched speed of ping test, meaning there’s barely any work being done anymore. But JSON test was considerably slower than other ones, and I realized that I’m using Express’s body-parser library for that, which uses Stream to read content of body. Instead of doing that, I implemented my own JSON parsing middleware that reads directly from uWS (unless reading already started, which can happen with async middlewares). And that increased speed from 30k to 40k req/sec for JSON test!

I had to make these optimizations quickly, before PR was merged. Other body parsing middlewares can be improved the same way too, so I’ll work on that.

Tomorrow, university session starts. They became quite lazy this year, with no classes at all scheduled for this session… Dean just told me to email professors myself.

… Now it’s 3 AM and I finished coding other middlewares, and all benefitted from the rewrite. There has been a bug ever since I switched Nekoweb to uExpress that made assets not update. For some reason they got cached in Cloudflare. I finally figured out why it was happening, apparently Express does support If-Modified-Since, while I didn’t support it properly. My version was not sending headers, including ETag and more importantly Cache-Control, which made Cloudflare default to normal cache time. Also that bad version got merged, so I quickly made a PR fixing their code and it got merged too, phew!

Now it’s all fixed, and everything is more performant. I’m satisfied.

Tags: #code

September 28, 2024

Started coding UltimateWS today. I was wondering if I should first finish UltimateWS before publicly publishing UltimateExpress, but I’ve decided that it’d be kinda weird to make 2 announcements at once, so today I actually published Ultimate Express. Honestly, I expected more reaction and interest. While I did get about 50 stars, I don’t think it’s a very good result and I feel a bit disappointed about it. Hopefully it’ll grow more eventually.

It’s been a nice rainy day, all day. I’ve been enjoying rain sounds for a while, and decided to go outside and feel rain on myself. I got winter clothes and went outside, and stood in the rain for a while. I love the feeling of being protected from rain by clothes. If I had a comfortable spot, I would probably just sit down and spend hours just sitting under rain, while hiding in my clothes fully. Clothes that fully cover me and allow me to get inside them are so cozy…

1000018526.jpg

September 27, 2024

Making Nekoweb use uExpress revealed a bunch of bugs, so I spent the morning fixing the reported stuff while I was asleep.

Today we went to buy sport clothes with brother. Bought 2 t-shirts, shorts and shoes.

1000018500.jpg

In 1 of the shops there was this escalator, and it’s the steepest and fastest escalator I’ve ever been on in my life. I genuinely almost fell while using it, it’s actually dangerous!

1000018503.jpg

After buying clothes we went to sushi place.

1000018508.jpg

Had a nice talk and then went home. When I came home I’ve noticed that energy drinks were back, looks like roommate actually bought them back, so that’s nice.

Continued coding uExpress at home. Fixed more bugs, tried async etag generation (fail), finalized some stuff. Looks like it’s truly done now, I don’t know what else there could be to add. Apart from WebSocket upgrade support, but that’ll need a separate library. Maybe I’ll start writing it tomorrow.

During night read some mangas (rare!) and added some more security stuff to Nekoweb.

September 26, 2024

We were supposed to go to the gym today for the first time, but brother said he had to stay late at work so we couldn’t.

I finally published uExpress to NPM… Well, I had to rename it. Apparently there’s a package called uexpress and you can’t have similar names (mine was called u-express), so I had to rename it to ultimate-express. A little disappointed, but whatever. Chose to go with Apache 2.0 License.

Migrated Nekoweb to use it, and thankfully it’s faster!!! About 2-3 times faster on average! It wasn’t all for nothing after all, yayyy! Finally added benchmark results to README. Apparently generating ETag makes server about 15k req/sec slower, but idk if it’s possible to optimize.

September 25, 2024

The most unpleasing thing in coding uExpress is routing. At this point, I don’t really understand what I’m doing. I get ideas on how to improve/optimize it but I often just make guesses on how it’s supposed to work. It’s no longer code I fully understand.

Today I fixed route optimization after I refactored callbacks and also implemented optimization of Routers. I could only figure out how to optimize 1-level deep routers, but I think it’s enough for almost all applications.

Roommate invited his friends today, and they were talking loudly and seemingly having fun. I had 2 energy drinks in my fridge, and they disappeared. So they just drank my stuff without permission…


Walked through the entire path to Rainy Apartments again. We wanted to explore it a little bit more, and just enjoy the scenery again.

1000018483.png

September 24, 2024

Started coding commission today, and did about half of the work. Finally aligned my monitors! They always were unaligned, left one being much lower. Maybe this will help with neck pain. After coding got tired and my stomach started to hurt, so I went to bed and napped for a hour. My brother called me saying he’ll come and we’ll check out gyms in the city.

We went to the cheaper gym first, which was fine, but kinda small and crowded. After that we went to much, much larger and premium gym and it was super cool, and also had a pool too. After that we went to a cafe nearby to talk and decide where to go.

1000018443.jpg

We’ve decided to go to the more expensive gym because of the discount, but when we came to ask about it, she said the price was already with discount. But the thing is, discount was given by some lottery wheel thingy on their site, and she couldn’t really know that we got it. So she either lied or the thing on site was just fake. We got very disappointed and the price without discount felt too much so we left. Very scammy practice.

After I came home I continued to code commission and finished it!


Played more Yume 2kki today. For the most part, pretty fruitless exploration today. As we were getting ready to leave, I got Mirror Room event and got into place with view on Twin Peaks.

1000018471.jpg

Unexpectedly, there was a person there. Usually when I meet people in Yume 2kki they are either AFK or just silent, but they actually talked first. We had a small little chat and they proposed to walk me to the Rainy Apartments, which I heard of before but never been to. After some hesistatation I agreed, and our long, long journey begun. I already was pretty sleepy by this point, but it was one of the most beautiful paths I’ve seen in this game.

1000018470.png 1000018469.png 1000018468.png 1000018467.png 1000018466.png 1000018465.png 1000018464.png 1000018463.png 1000018462.png

1000018461.png 1000018460.png 1000018459.png 1000018458.png 1000018457.png 1000018456.png

After meeting Hatsune Miku in Virtual City, we finally got to Rainy Apartments. No wonder they’re such a popular location, they’re definitely on level of Sewers and Secret Society. I love rainy places so much…

1000018455.png

1000018454.png

1000018451.png

1000018453.png

It was the end of our journey for today. It’s so weird to think that if random event didn’t happen, I wouldn’t meet this person and wouldn’t ever get guided to see this place. I’m so glad that it happened.

September 23, 2024

It’s unbearable to use computer at day — the sun shines too brightly. I often just spend the time in my bed waiting for it to go away.

Decided to meet brother today, and we went outside to eat and walk around.

1000018410.jpg

Pretty cozy place, I really like the brick wall and lamps on the tree. We both ordered ramen:

1000018413.jpg

After talking and eating food we went to shop and I bought cat socks and some cosmetics.

1000018417.jpg

Another cool brick wall. I’m a big fan of these.

Maybe I’ll start going to gym soon. I have a very sedantary way of life, and I can feel my body feeling tired and bad constantly. I also want to get full medical checkup. While talking about that with brother, he told that we should probably make our dad also get one. Brother came home and talked with dad about it and he surprisingly agreed, so I guess we’ll arrange that soon.

█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████

September 22, 2024

Yay, fixed issue with hanging! Apparently it was caused by pushing too much data into Writable stream. uWS returns about 512 KB chunks, while Writable disk stream can only handle at most 128 KB (and by default Express sends 64 KB). After I made it save data in buffer and only send 64 KB chunks instead it works! No more hanging and empty files.

Tags: #code

September 21, 2024

I think I’m getting sick of coding this thing now. Now coding it is not fun but constantly frustrating. I have finally finished the last thing in the compatibility list and started testing it on my real projects, with first one being Diary. It couldn’t start at all for some reason, and apparently I needed to make sure port is a number. Then for some reason assets kept sending 404’s, and that was due to bad handling of conditionals. After I implemented If-Modified-Since properly it fully worked with no issues! Diary can use uExpress fully.

Then moved onto Nekoweb. Immediately there was some issue with routing, request was replied twice. After some terrible debugging session (uWS fucking removes stack trace!!!) I managed to fix it. But now I’m stuck at weird issue with express-fileupload, it just doesn’t write anything into file and often hangs forever, and I’m not sure why it’s happening. So frustrating. I also realized that my solution with skip keys is actually terrible, Nekoweb has a ton of middlewares on each endpoint, but with my way it has to go through every single one when it could only check pattern once, so I’ll have to recode that as well.

Tags: #code
1 2 3 [4] 5 6 7