DEV Community

Cover image for Forem (Dev.to) is slow, so I del...optimized it.

Forem (Dev.to) is slow, so I del...optimized it.

April Fools Challenge Submission ☕️🤡

This is a submission for the DEV April Fools Challenge

Disclaimer: This post is very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very satire. Although you already know this based on context clues, I just want to let you know before hand just in case if somehow you miss the "clues". Forem is great and @ben, @jess and @peter did nothing wrong to me or anyone in this community! :)


What is happening

I notice that Forem has been receiving a lot of traffic lately and it is slowing down my Windows 7 PC. Don't get me wrong, I like the idea Ben is creating for Forem and allowing communities to come together. However, I notice it is very slow on low ended computers and I feel like Forem is not really accessible for those who does not have a powerful PC. How can you have an empowering community if that community is using a low ended PC?

It's hard to show what it is like for me to use Forem since I can't record using OBS since you know...OBS is slow and Forem is slow which equals Slower so here is an accurate representation of using Forem on an everyday basis.

To be fair, the best thing about Forem is that it is Open Source! I can contribute to my needs and express my wants! I heard Ben is a wonderful person and he loves to take community ideas! Besides, Jess mentioned in her "A Year of Change and Persistence" post where Dev.to was created by @ben, @jess, and @peter which they are known as PBJ, like the sandwich. This shows me that they are nice people and they are definitely the type of people where you can joke around with!

Their inclusiveness and kindness inspired me with this Pull Request that I did and I believe it will optimize their platform to great extent and I believe this Pull Request will be the next best thing to AI in my opinion based on the solution I have.

 


What I...Built?

I heard people are building this and building that to make the project better, but it's never about deleting. I recently read a post by the @the_nortern_dev on the skill of coding:

It is true! You learn the skill as a dev by deleting it, so I took that inspiration and optimize the code by removing redundancy and refactoring the code where it can speed things up for Forem. I have learn a lot from this such as learning a new technology and using GitHub!

I also heard AI is mainstream so I use Google Gemini to help me with this Pull Request. One of the things it helped me is figuring out how to make it O(1) constant time for Forem and this is what it gave me:

Image

Based on this response, I edit the code base and made the Pull Request!

 


The Pull Request that ends all Pull Requests

I am so happy to share my PR, which I included below!

Remove Redundancy to Prevent Heavy Traffic #23110

What type of PR is this? (check all applicable)

  • [x] Refactor
  • [ ] Feature
  • [x] Bug Fix
  • [x] Optimization
  • [ ] Documentation Update

Description

This PR address where traffic is slow when it comes to computers running Window 7 or before. This PR fixes the issue where it removes modern code and refactor to legacy code where it runs on all systems whether you are running Windows 7 before or later. The time complexity reduces to O(1) as well as space complexity where both were initially O(n).

Related Tickets & Documents

  • Related Issue #AprilFools
  • Closes #AprilFools

QA Instructions, Screenshots, Recordings

Go to Forem.com to see the changes.

UI accessibility checklist

  • [x] Semantic HTML implemented?
  • [x] Keyboard operability supported?
  • [x] Checked with axe DevTools and addressed Critical and Serious issues?
  • [x] Color contrast tested?

Added/updated tests?

  • [x] Yes
  • [ ] No, and this is why: please replace this line with details on why tests have not been included
  • [ ] I need help with writing tests

What gif best describes this PR or how it makes you feel?

speed

Note: Please @ben I need this. Forem is kind of slow. I optimize the code, so please check it out! I emailed the Forem Team and they tried not to laugh man. They sent me this and I feel like this is a mockery to the Dev.to community!

 


Code in Detail

This is the solution I did.





















Enter fullscreen mode Exit fullscreen mode

and that's how I optimized it. Pretty straightforward.

 


How I Built It?...

Like any other open source, you edit the code base. The solution I had was unique. Instead of typing letters/characters/symbols, I just press "Backspace" on my keyboard and it did the magic. It reminds me of Vibe Coding. Different approach, same solution or something.

It's quite revolutionary actually. I learn about how to make new lines, tab spaces, etc. Like one said:

 

If there is a void, there is nothing to destroy.

 

This applies here. How can someone steal information in a website if there is nothing to steal. We are continuously building and refining firewalls and security and overengineering it to the point where we forgot the ability to think simple. Just remove it.

Scam would not exist if the product does not exist. If anything, I called that free space. Healthy for the environment and no need to build more data centers and other technology stuff!

 


I heard there is a Prize Category, so I guess honorable mentions?

I like to shout out to Google Gemini for this process since it helped me in the Pull Request. I treat AI as I treat my car.

Anyway, before making the Pull Request, I had to make sure Forem was slow to begin with and here was its response:

Image

With this answer, I can confirm 100% that Forem is Slow since AI is always right. Google Gemini gave me motivation to make a difference to Forem and I am glad to make this Pull Request to the Official Forem Repository.

Also a shout out for me giving an Ode to Larry Masinter. Not sure or something but I heard he likes tea 🫖. However,

 

I don't know where it is...

 

Also also, I shout out to this community since I believe we all agree that this change will make a significant impact to the community on the daily basis!!! I encourage the community to like/comment/share/and spam ping the Dev Team (please don't actually) so we can get this change implemented ASAP!!

Prize Category TLDR: Best AI, Teapot, Community.

 


Take a look at the new Forem!

If you would like to see a faster Forem for empowering communities, check it out here where I did a video demonstration on the differences.

If you like to see the demo version yourself that I self-hosted, check it out below!

See Demo here!

Questions/Comments/Feedback? Love to hear you!

Top comments (43)

Collapse
 
embernoglow profile image
EmberNoGlow

Excellent work. A few months ago, I was using Windows 7, and Forem seemed to work fine. Either I had plenty of RAM (8 GB), or the platform really did slow down. (Or, it's possible you have a weak computer. Although, it's hard to find one weaker than mine these days.)

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Hey Ember. The platform really slowed down whenever I am on Window 7. The specs I have is usually 1 MB of RAM and I have to use a toaster box as my PC box. The motherboard I had was an Arduino hooking up on public electricity.

I could search up tutorials on how to build my PC but I saw 5 minute craft did it and it work so I tried it. Not sure what I did wrong.

Thanks! :D

Collapse
 
embernoglow profile image
EmberNoGlow

1... mb?! Wow..😪

Thread Thread
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Ikr

Collapse
 
learn2027 profile image
meow.hair

windows 95😁

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Why 95 where it can be 100%? I would like Windows 100 lol

Collapse
 
learn2027 profile image
meow.hair

"Sorry, my reply wasn't clear. I meant Windows 95 the operating system — the old gray boxy interface from 1995. Not 95%. Just a joke about how it looks now 😄 I wish you further progress and success."🤍

Thread Thread
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Oh ik lol. Sorry if I was not specific

Collapse
 
harsh2644 profile image
Harsh

This is the kind of deep-dive I wish more developers would do instead of just complaining about performance. 🔥

The lazy loading on user_profile_views and rating_votes was a smart catch — those aggregates can definitely become silent killers at scale.

Quick question though: Did you consider moving those counters to a separate Redis cache layer instead of lazy loading? That way you could update them async and keep the main feed queries even cleaner. Curious if you tested that approach or if Postgres optimization was the intentional first step.

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Hey Harsh! I prefer moving the counter into Docker since it is faster than "loading". The reason is that I hate loading screen in websites because it takes too much space, so I tend to delete it.

Everything is too complicated now-a-days since I remember websites runs on HTML, CSS, and JS. Now, it is run on Redis, Ruby and such so I delete it. Having complicated programming languages is a skill issue since we can optimize websites with just Vanilla HTML and CSS and JS.

Thanks for reading :D

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

Hahahahaha it's a masterpiece 🤩

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Thanks Sylwia! Glad you enjoyed the new update! :D

Collapse
 
best_codes profile image
BestCodes

"somehow miss the clues" yeah how the heck would I miss this 😭

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Great question lol. I have experience where something were so obvious but for some reason the other person does not see it. Strange but gotta make sure because you never know XD

Collapse
 
automate-archit profile image
Archit Mittal

Performance optimization on a live platform with real users is always more interesting than theoretical benchmarks. The tricky part with Forem is the Ruby on Rails monolith - you're balancing N+1 query fixes against the ORM's convenience. Curious if you looked at adding database-level caching with something like pg_stat_statements to identify the worst offenders, or if the wins were mostly at the application layer. In my experience, the biggest Rails performance gains usually come from eager loading and fragment caching rather than architectural rewrites.

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ • Edited

Hey Archit! Forgot to respond to your comment!

I also removed the database along with things related to the application layer. The problem is that database takes too much space where it is much easier for us to just remember it

We rely on too much technology to the point where we got very lazy. Not only it frees up space, but it also helps us to become more productive instead of just Vibing it. If I was a Rails contributor, I would delete it too. Too many programming languages these days where we can just stick to one.

Thanks again :D

Collapse
 
dhruvjoshi9 profile image
Dhruv Joshi

This was hilarious 😄 The “optimization by backspace” joke landed perfectly, but it also sneaks in a real dev truth: sometimes the best performance win is removing complexity, not adding more cleverness.

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

It is true! The best performance is based on simple solution instead of complexity. The simpler the better. It's also good for readability as well, so it's a win-win!

Thanks for reading Dhruv!

Collapse
 
fluffyfi3 profile image
Ella

Less can be more sometimes 😄

Collapse
 
tariq_sheikh_956038b12328 profile image
Tariq Sheikh

wow

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

It is true non-jokingly XD

Though I prefer everything to be gone since it is simpler. Thanks!

Collapse
 
benjamin_nguyen_8ca6ff360 profile image
Benjamin Nguyen • Edited

yes, super mario :)

Collapse
 
rahul_patwa_f99f19cd1519b profile image
rahul patwa

nice 🤣

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

:) supermario, yes

Collapse
 
benjamin_nguyen_8ca6ff360 profile image
Benjamin Nguyen

nice!

Thread Thread
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

thank

Collapse
 
travisdrake profile image
Travis Drake

Beautiful

Collapse
 
francistrdev profile image
FrancisTRᴅᴇᴠ (っ◔◡◔)っ

Truly Beautiful indeed lol

Thanks Travis!

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more