Skip to content

Commit

Permalink
feat: publish week 32 in review
Browse files Browse the repository at this point in the history
  • Loading branch information
carbontwelve committed Aug 24, 2022
1 parent 6c6f3cf commit b17ff2a
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions content/thoughts/2022-08-14-wk-32-in-review.md
@@ -0,0 +1,41 @@
---
title: Week 32 in Review
tags:
- "Week In Review"
growthStage: evergreen
---

> _"Freedom is the only worthy goal in life. It is won by disregarding things that lie beyond our control."_
> — Epictetus
This week has been spent split between a Node.js project and Laravel. The Node project uses [Fasifty](https://www.fastify.io/) with [Prisma](https://www.prisma.io/) and [Redis](https://redis.io/) to build a service for our routing engine to be hosted on aws lambda.

The project itself is going well, coming from PHP there was a huge shift in mindset needed at the beginning as building for lambda comes with its own constraints. When making requests for example I kept hitting a delay of two seconds before each request would process.

Using the [JavaScript Performance measurement APIs](https://nodejs.org/api/perf_hooks.html#performance-measurement-apis) I was able to nail this down to the first database query. It's a simple query and ran in about 500ms within [TablePlus](https://tableplus.com/), even quicker at 23ms once I added an index on the two columns being filtered, so why the ~2000ms delay?

It turns out the delay is the Prisma.js cold boot time. This is compounded by the fact that I am booting Prisma for each request meaning it ends up garbage collected rather than remaining in global scope for all requests to utilise. The solution I have yet to implement is writing a Fastify Plugin to instantiate and expose the Prisma Client instance. The cold boot time will still be there but importantly; it won't be felt by every single request.

## Joke of the week
_"Why did the scarecrow win an award? Because he was the best in his field."_

## Notable Articles Read
- [Jakob Greenfeld: No more "Insight Porn"](https://jakobgreenfeld.com/insight-porn)
- [Joe Morrison: Google Maps' Moat is Evaporating](https://joemorrison.substack.com/p/google-maps-moat-is-evaporating)
- [Ben Hoyt: Rob Pike’s simple C regex matcher in Go](https://benhoyt.com/writings/rob-pike-regex/)
- [Keunwoo Lee: On rebooting: the unreasonable effectiveness of turning computers off and on again](https://keunwoo.com/notes/rebooting/)
- [Adrian Holovaty: Let websites framebust out of native apps](https://www.holovaty.com/writing/framebust-native-apps/)

## Notable Videos Watched
- [4 EASY Starter Farms For 1.19 Survival Minecraft!](https://www.youtube.com/watch?v=e0LqWbILLDY) by [Gorillo](https://www.youtube.com/c/Gorillo)
- [Minecraft | How to Build a Barn for Animals](https://www.youtube.com/watch?v=c0Xh6R98BIk) by [Zaypixel](https://www.youtube.com/c/Zaypixel)

## Cool things from around the internet
- [Radio Art Zone](https://radioart.zone/)
- [Hot: a macOS menu bar app for displaying temperatures](https://github.com/macmade/Hot)
- [luxe: A lovingly crafted cross platform game engine](https://luxeengine.com/)
- [PHP Desktop](https://github.com/cztomczak/phpdesktop)

## Game Wishlist
- [Mossfield Origins](https://store.steampowered.com/app/1836400/Mossfield_Origins/)
- [Going Medieval](https://store.steampowered.com/app/1029780/Going_Medieval/)

0 comments on commit b17ff2a

Please sign in to comment.