Look up Holla Forums's source code in hopes of figuring out why auto-update lags the...

Ryan Reed
Ryan Reed

look up Holla Forums's source code in hopes of figuring out why auto-update lags the browser on long threads
find the appropriate JS
something seems wrong, how come the request is sent to the same URL you're at with no extra information?
see something akin to jqueer.find('reply')
it finally dawns on me what's happening
When Holla Forums threads auto-update, they load the entire page
the entire page again as HTML, rip out the posts from the HTML string using pajeetquery, and then appends them onto the thread.
This happens every time the thread updater reaches 0.

I can't take it anymore, I need Holla Forums to burn to the ground so this piece of shit software can be replaced with literally anything else.

What can we do besides wait for a slow replacement of bits and pieces over the next decade? I'd go on an autistic rewriting rampage but I don't know anything about backend development.

All urls found in this thread:
https://transitiontech.ca/random/RIIR
https://www.w3schools.com/html/html5_serversentevents.asp
https://github.com/ctrlcctrlv/infinity/issues/552
https://github.com/OpenIB/OpenIB
https://github.com/bakape/meguca
https://github.com/OpenIB/OpenIB/blob/master/js/thread-stats.js#L27
https://github.com/OpenIB/OpenIB/blob/master/js/show-own-posts.js#L73
https://ghostbin.com/paste/5nxd7
https://ghostbin.com/paste/br5s9
Henry Hughes
Henry Hughes

https://transitiontech.ca/random/RIIR

Connor Rivera
Connor Rivera

I'd rather take something written in Rust than what we have.

Andrew Young
Andrew Young

.ca
rust
two times the gay

Justin Gonzalez
Justin Gonzalez

I'd sooner rewrite it in Java.

Ryan Robinson
Ryan Robinson

Rewrite it in Gopher.

Anthony Harris
Anthony Harris

transition
.ca
HMMMMMMMMMMM

Daniel Green
Daniel Green

Why not bitch about it on /sudo/?

Adam Martinez
Adam Martinez

If you think that's bad, try loading the catalog with the JS profiler running and look at all the pointless reflows. This flaming sewage fire should be renamed lagchan.

I'd go on an autistic rewriting rampage but I don't know anything about backend development.
It's called NextChan and it runs a thousand times better than this site.

Angel Robinson
Angel Robinson

On w3schools or some shit i came across,
server sent events
https://www.w3schools.com/html/html5_serversentevents.asp

Is there a chan who has this implmeted?

Ethan Gray
Ethan Gray

Ever even considered it could be because of caching, you screeching autist?

It's faster to have the entire page cached, so it can be send to everyone right away, than to rebuild custom pieces for everyone's individual requests.

God damned, this place really is full of pajeets.

Levi Jackson
Levi Jackson

Holla Forums only LARPs

Grayson Rodriguez
Grayson Rodriguez

It's faster to have the entire page cached, so it can be send to everyone right away, than to rebuild custom pieces for everyone's individual requests.
But 8ch is not fast, QED.

Easton Taylor
Easton Taylor

Nextchan doesn't run better. It needed huge fixes to be bearable at all.

And it's not even online at this very moment, although that's a DNS problem, not a Next problem, so I don't know if it counts.

Dominic Torres
Dominic Torres

Since when was Codemonkey is actually making recent commits public? Last I heard of Holla Forums's source code, it's way outdated, the last time being Hotwheel's commits.

Anthony Rodriguez
Anthony Rodriguez

Since the hack. Partially because the source code was leaked, partially because he started hardening it a bit.

Benjamin Perez
Benjamin Perez

Then fix it and submit a pull request if you're so smart.

Jaxon Nguyen
Jaxon Nguyen

Using the JSON API for this might be reasonable. A problem with that is that in Infinity it doesn't contain all the information the HTML page does (for example, the 000000 IDs).

Eli Phillips
Eli Phillips

So you're saying they do this for the advantages of CrimeFlare?

Brandon Powell
Brandon Powell

No, this is about the cache on the server. Cloudflare is not the only thing that does caching.
The current system does happen to be more Cloudflare-friendly, but sending only partial threads would be unfeasible considering the way the software now works.

Luis Rogers
Luis Rogers

Why don't you? Oh wait, you can't
https://github.com/ctrlcctrlv/infinity/issues/552

Zachary Adams
Zachary Adams

Hey genius, the code's over here.
https://github.com/OpenIB/OpenIB

Matthew Cruz
Matthew Cruz

That's not even why it freezes, it's because of this shit

Jack James
Jack James

freddit and jewsh are PHPfags
they use jquery like it's 2012
wew i didn't know it was this bad

Kevin Gomez
Kevin Gomez

like it's 2012
infinity Copyright © 2013-2017 N.T. Technology, Inc. based on sources from Fredrick Brennan's "Infinity Development Group"

Isaiah Brown
Isaiah Brown

infinity next was made last year, you fucking dunce

Landon Hill
Landon Hill

But this thread is not about Infinity Next.

Brayden Gutierrez
Brayden Gutierrez

I didn't say anything about Josh.

David Nguyen
David Nguyen

Holla Forums doesn't uses Infinity Fagxt doofus

William Smith
William Smith

It sounds like you missed the beginning of April when someone took Holla Forums down for 4 days, got access to the server and leaked the source code.

Isaac Butler
Isaac Butler

Has anyone considered rewriting Infinity Next in Rust?

Grayson Rodriguez
Grayson Rodriguez

Blazechan is Infinity Next without a dogshit (Laravel) sessions framework preventing proper caching and probably planned integrations with captchas not heavily integrated into the backend (like Next did)

Not to say that Next was unfixable, just that no one had the motivation to fix it after anons had done the post mortem and figured out where it had fucked up.
Ironically Fred's captcha was the "function of quadratic complexity." It was both Hotwheels and Josh's fault. Hopefully m712 will do anti-spam in a two-step validation process, thus not generating captchas for every robot/HTTP (HEAD|GET) that comes around (like Next did.)

Gavin Robinson
Gavin Robinson

We voted a long time ago to replace the flaming garbage can called infinity with lynxchan after the hilarious failure of infinity next but Jim decided to be autistic and just try to throw water on the flames every so often because he's a lazy good for nothing nigger.

And now here we are at least, what? A good year or more later? And we were raped up the ass with a database hack because infinity is complete dogshit. I hope someone will just find an exploit so horrendous and utterly burn Holla Forums to the ground so that it will force Jim's hand to finally abandon this piece of poojeet-tier imageboard software.

Aiden White
Aiden White

implying Jim gives two fucks about this website
Just read the source code to find the horrendous exploits you're referring to.
The only reason Holla Forums wasn't "burn to the ground" yet is because the number of tech literate people whiling to take it down is pretty small.

Parker Clark
Parker Clark

the entire page again as HTML, rip out the posts from the HTML string using pajeetquery, and then appends them onto the thread.
jesus
welp we definitely need to fix that

Tyler Ross
Tyler Ross

Doesn't contain the bright red text mods append to messages either

Ethan Thomas
Ethan Thomas

Wait does it regenerate the page even if there's no new information?
what in the actual fuck

Gavin Morales
Gavin Morales

No, only the posts it can't already find on the page.

Jaxson Scott
Jaxson Scott

does firefox have similiarly nice tools?

Michael Roberts
Michael Roberts

Except you're another moron who didn't know what you were talking about at the time, despite the fact that numerous anons told you that Lynxchan was shit.
Lynxchan is just as broken as vichan/Infinity, with the file contention issues. Lynx had to put a n arbitary queue in front of it just to work around the MongoDB contention issues.
This isn't even getting into the fact that even an uncached Infinity Next is faster at templating than Lynxchan. Let that sink in. Lynxchan is dogshit, you never knew what you were talking about, and your opinion is null and void.
Source: Lynx's own benchmarks, lost to time, that he proudly strutted out in a thread.
Not that I'm surprised a masturbatory OO nightmare PHP templates faster than whatever dogshit hipster nodejs trash he uses, but it's still funny.

Connor Turner
Connor Turner

Just turn off JS nigger. The web isn't made for running code. I can't name a single website that doesn't fuck over my computer with JS enabled. What I want these niggers to fix is being able to post with referrer header disabled.

Charles Roberts
Charles Roberts

the code on these websites is shit therefore you should reject code altogether
kys my man

David Howard
David Howard

I'm building a new imageboard software this summer, I have already started. I haven't found anyone to do the frontend yet, so right now it looks like the backend will be in Java (Spring Boot) and the front will be rendered using Thymeleaf. It should be faster and more reliable, than all existing alternatives written in (((PHP))) once I finish it.

Luke Adams
Luke Adams

Does Lynxchan work in Lynx? Does vichan work in vi? I'm getting the impression some of these chans are false advertising.

Blake Diaz
Blake Diaz

kek

Josiah Green
Josiah Green

well enjoy running a bunch of pointless JS slowing the fuck out of your browser then...

Juan Allen
Juan Allen

the backend will be in Java
PAJEET NO

Asher Ramirez
Asher Ramirez

the backend will be in Java
Truly street shitter-tier

John Jackson
John Jackson

pointless JS
I wouldn't use Holla Forums if I had to refresh every time I post or want to know if there's new posts on a thread. And that's just one advantage.

Kayden Campbell
Kayden Campbell

rare (((uguu)))

Elijah Robinson
Elijah Robinson

Lynxchan is named after the developer's handle. Vichan is pronounced "six-chan".

Kayden Sanchez
Kayden Sanchez

a good user experience is bloat

Isaac Collins
Isaac Collins

posts aren't made here often enough to care about having to press f5.
leaving browser opened for long periods of time
lol
no, but it's better off left to a proper program instead of a website. that said the current programs that do this are also shit. but see for example utorrent or qbittorrent vs whatever trash offerings exist for the web

Ryan Morris
Ryan Morris

When Holla Forums threads auto-update, they load the entire page

this shouldn't slow the browser. to open a simple page like this, it shouldnt take more than a few ms. and then reopening the page should be exactly as negligable. im sure for some CSS and other webshotting reasons, it's super expensive to load a simple page with text and images like this though. this is why people should be writing actual programs instead of websites for applications such as chat and forums.

the entire page again as HTML, rip out the posts from the HTML string using pajeetquery, and then appends them onto the thread.

while this is a retarded way to program, it still shouldn't be expensive enough to notice

Samuel Phillips
Samuel Phillips

i might go back to usenet at this rate

Asher Ward
Asher Ward

I thought this place will be better than 4chan /g/, but nope. Still /v/tards larping and spewing memes.

Robert Foster
Robert Foster

Have you tried the nntpchan?

Justin Martinez
Justin Martinez

What am I looking at?

Gabriel Peterson
Gabriel Peterson

someone linked me to this thread just now I have not been on Holla Forums since november since it's worse than moot's 4chan by several orders of magnitude.
turns out that most decent programmers know why js is garbage
i'm shutting down my servers unless it gets a decent uptick in the next month, since like nobody cares about having REAL decentralization, everyone wants their gay hugbox.

Cameron Cruz
Cameron Cruz

nobody cares about having REAL decentralization
Nobody cares about nntpchan because it's shit. Nobody wants to use that dysfunctional garbage except the most neckest of beards.

Henry Watson
Henry Watson

I can see several problems here. First, hardly anyone knows nntpchan exists. And if you search on DDG, it returns results to github pages, onion links (not everyone uses Tor), and various other chans (including ponychan !) before anything resembling an nntpchan instance.
Finally I got on pic. Ok, so the interface is kinda weird and maybe takes some getting used to. Fine, but why isn't there even a "reply" link when you open a thread by clicking on the matching "N№" string? All I see then is more such symbols but this time clicking them does nothing. So I looked at the html src and search for "reply" and find a javascript function. That's an obvious problem, since the dudes who are gung-ho enough to use Tor probably don't want to use JS as it's one of the biggest attack surfaces. Even I avoid JS, despite not using Tor.
This stuff could probably be fixed pretty easily too.

Noah Perez
Noah Perez

wrong pic

Gavin Torres
Gavin Torres

It's shit.

Jacob Morgan
Jacob Morgan

Is it true that the Holla Forums catalog loads images full size and then shrinks them down to thumbnail size every time you view it?

Kayden Clark
Kayden Clark

tfw nobody's literate enough to tell you

William Ward
William Ward

three times the gay

Ayden Kelly
Ayden Kelly

ctl+f
ajax
no results found

Come on guys....

James Young
James Young

Look at your browser console. All the images that are requested seem to be thumbnails, so I doubt it.

Jordan Mitchell
Jordan Mitchell

I don't know if they use SSE, websockets, or something else. But I imagine this does it efficiently.
https://github.com/bakape/meguca

Jaxon Barnes
Jaxon Barnes

Basically, what OP said is true, auto-update fetches and parses the entire page. The initial parsing takes a hundred ms or so depending on the thread.

Then for each new reply added it triggers a 'new_post' event, which calls the functions highlighted in images 3 and 4. The function in image 3 consumes the majority of the cpu time (about 400ms per reply). I'm not sure exactly what it's doing, but that is some of the ugliest abuse of jquery I have ever seen.

Justin Taylor
Justin Taylor

Found the source
Slowest function:
https://github.com/OpenIB/OpenIB/blob/master/js/thread-stats.js#L27
Second slowest:
https://github.com/OpenIB/OpenIB/blob/master/js/show-own-posts.js#L73

Henry Jenkins
Henry Jenkins

There's also frequent ajax requests to threads.json even when you disable every auto-update thing in the options. What a clusterfuck

Parker Sanchez
Parker Sanchez

So why wasn't this caught sooner? Has the number of people actually *looking* at the code really been that low?

There actually was a gopher imageboard for awhile. Nobody used it.

Caleb Nelson
Caleb Nelson

gopher://gopher.su/1/board is still up, but I'm not sure image upload is working.

Aaron Jackson
Aaron Jackson

It's not news to me, or to most other people who've taken a critical look at the JSON interface, probably.

Xavier Martinez
Xavier Martinez

Whose dick do we gotta suck to get CM to actually fix this? Jesus christ.

David Green
David Green

AFAIK that's what the script uses to get page number on the bottom right of the thread. I can't think of any other way it does that since the thread itself does not contain the page number.

Nobody wants to look at the code because of how terrible it is.

It's like there's a gas leak somewhere, but you need to go wade into a shit and mold covered sewer to find it, and then you need to convince some guy that nobody knows and is barely reachable in the first place to let you start a repair operation that you need to completely organize yourself.

Camden Bennett
Camden Bennett

We are currently testing some new auto-reload methods. After we get a good working one, then ill push the change to the github repo.

Andrew Morales
Andrew Morales

dont bother. im currently working on tamachan written in rust.

Christopher Green
Christopher Green

Got a link?

Angel James
Angel James

not yet. soon though.

Robert Brown
Robert Brown

Looking forward to checking it out.

Andrew Cook
Andrew Cook

you should wright it in brainfuck instead. Rust has the poz

Oliver Barnes
Oliver Barnes

brainfuck is not blazingly fast and has not fearless concurrency

Adrian Watson
Adrian Watson

Hey codemonkey look at pics related and tell me the UI couldn't be better.

James Flores
James Flores

(pic on top is the modified one, one below is the original for comparison)

Ethan Foster
Ethan Foster

I've thought about just disabling the site JS in umatrix and rewriting the entire thing from scratch as a userscript. Would probably load 10x faster.

Eli Campbell
Eli Campbell

disabling the site JS in umatrix and rewriting the entire thing from scratch as a userscript
I actually did exactly that this weekend. Loading posts in long threads only has a minor frame drop now. Plus I was able to improve a whole host of other things about the site.

I haven't found a fast moving long thread to test it properly though.

Michael Richardson
Michael Richardson

Nope. The the ones on Edge are decent, but FF's are just garbage.

Owen Wood
Owen Wood

It is expensive for one reason. When you load and parse a page with the browser, it's done in C++. When 8ch keeps redownloading the whole page, it's all done in JS. Parsing in JS is fucking slow.

Michael Thomas
Michael Thomas

why don't you post it?

Daniel Myers
Daniel Myers

I don't want to be responsible for fixing problems and adding things for other people.

Michael Fisher
Michael Fisher

Just post it on /g/ and never read the board again

Carter Wood
Carter Wood

/g/

Asher Morgan
Asher Morgan

That sounds like you don't have shit working.

Bentley Stewart
Bentley Stewart

shit that's wrong. I meant don't have shit at all.
But even if you do it'd still be interesting to see. So many people on Holla Forums brag about some project they're working on, but nothing to show for it.

Jordan Thomas
Jordan Thomas

I don't brag or show my projects (anymore) because I don't know shit about programming.

If you want to try it then here it is.
https://ghostbin.com/paste/5nxd7

And here's the CSS to go along with it. It's more or less required or else everything will look fucked.
https://ghostbin.com/paste/br5s9

Daniel Howard
Daniel Howard

/g/index.html
Holla Forums has more than one board.

Justin Reed
Justin Reed

I know but I thought /g/ was completely dead.

Colton Scott
Colton Scott

Just realized that I forgot to remove my word filters from the code

Isaiah Bailey
Isaiah Bailey

That's the plan, post it somewhere that requires two brain cells to find. If it's in a thread here any moron that bounces from 9gag to Holla Forums via the front page will start shitting the conversation up.

Oliver Scott
Oliver Scott

look up Holla Forums's source code
stopped reading there
stop being such a nerd!

care more about bettering yourself than some dumb webpage

prioritize

Ethan Price
Ethan Price

spend a few days improving my Holla Forums experience
benefit for the next N years or however long I'm going to stay here

Eli Long
Eli Long

How long have you been working on making this?

Caleb Brown
Caleb Brown

I've had some of it for a long time, like the word filters.

Did most of it last week though.

Jeremiah Ward
Jeremiah Ward

That's a lot of work, nice job user. Now I need someone to check this and be sure it isn't going to botnet me and sign me up for elderlybearsxxx.com again

Kevin Lewis
Kevin Lewis

it's plain text in a cancerous font

Luke Cook
Luke Cook

Now I need someone to check this
It's full of disjointed and unused crap and lack of comments. I didn't exactly clean it up for release or anything.

I'd have posted to gitgud but I can't login anymore since they fucked with the accounts.

David Green
David Green

fuck i have that same shirt

Connor Green
Connor Green

Kinda off-topic but what is the best resource for a technically competent person to learn how browsers actually work and how to best design a web frontend to minimize repaints and whatnot? I work in embedded, I know I could understand this clusterfuck if I tried but it's extremely difficult to find writing on these subjects that isn't either spoonfeeding for retards, or assumes you already know everything.

Robert Adams
Robert Adams

When Holla Forums threads auto-update, they load the entire page, the entire page again as HTML, rip out the posts from the HTML string using pajeetquery, and then appends them onto the thread.
This happens every time the thread updater reaches 0.
You just made my day with this.
Now I have a good excuse to kill myself.

Disable AdBlock to view this page

Disable AdBlock to view this page