August 2022: JavaScript Maps and Streams and Performance Testing, Oh My!
Technically the maps are in React, and the streams are in Node.js, but it's all JavaScript in the end.
Hey friends,
I hope this month’s newsletter finds you doing well. Even though it’s still plenty hot where I am, summer is winding down here in the States, and people are getting ready for fall. Personally I’m a fan of warm weather so as much as some people are excited for pumpkin-spice everything and colder weather, I’m fine with things as they are. Give me shorts and flip flops any day.
But that’s not what we’re here to talk about, we’re here for the tech news, and I’ve got some good JavaScript related content that I think you’ll like.
First up, a blog I wrote about rendering multiple colored lines on a React-based map with React Leaflet.
This project came out of a company-wide hackathon earlier this year, and it was inspired by a previous asset tracking dashboard I’d built. The dashboard ended up coming in handier then I’d expected when my parent’s car was stolen with a tracking device in the backseat, and we used it to follow the car for the first hour after the theft happened.
The twist with this project though, is that it has the ability to change from regular blue lines connecting the location dots on the map, to red lines at the touch of a button: an “SOS Mode”, if you will. The idea is to make asset tracking under normal or emergency conditions easier to differentiate between the two to aid in recovery.
It was fun to work on for a day, and with the help of a Next.js application, React Leaflet and polylines, I was able to accomplish what I wanted and show off what I was able to accomplish at the end to my coworkers. Hopefully this post might come in handy for you in the future.
And following up on an article I published last month about using Node.js to read really large files, I wrote a second post comparing the performance of the three solutions I came up with.
A coding challenge shared on the Internet around large datasets piqued my interest enough to go about solving it with Node.js, and I ended up coming up with three separate solutions, two of which ran out of memory when I got to the largest dataset in the challenge.
After solving the challenge, I wanted to find out which of the solutions was most performant (at least on smaller datasets), and I ended up using both console.time and performance-now to be able to double check my findings. If you’re curious to see what’s fastest, you can read the whole post here.
I hope you enjoyed this month’s edition of “Paige Codes”. Please share with your friends if you did.
See you again at the end of September,
- Paige