Look up Holla Forums's source code in hopes of figuring out why auto-update lags the browser on long threads

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.

Other urls found in this thread:

transitiontech.ca/random/RIIR
w3schools.com/html/html5_serversentevents.asp
github.com/ctrlcctrlv/infinity/issues/552
github.com/OpenIB/OpenIB
github.com/bakape/meguca
github.com/OpenIB/OpenIB/blob/master/js/thread-stats.js#L27
github.com/OpenIB/OpenIB/blob/master/js/show-own-posts.js#L73
ghostbin.com/paste/5nxd7
ghostbin.com/paste/br5s9
twitter.com/NSFWRedditGif

transitiontech.ca/random/RIIR

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

two times the gay

I'd sooner rewrite it in Java.

Rewrite it in Gopher.

HMMMMMMMMMMM

Why not bitch about it on /sudo/?

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.

It's called NextChan and it runs a thousand times better than this site.

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

Is there a chan who has this implmeted?

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.

Holla Forums only LARPs

But 8ch is not fast, QED.

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.

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.

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

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

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).

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

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.

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

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

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

...

wew i didn't know it was this bad

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

infinity next was made last year, you fucking dunce

But this thread is not about Infinity Next.

I didn't say anything about Josh.

Holla Forums doesn't uses Infinity Fagxt doofus

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.

Has anyone considered rewriting Infinity Next in Rust?

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.)

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.

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.

jesus
welp we definitely need to fix that

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

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

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

does firefox have similiarly nice tools?

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.

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.

kys my man

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.

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

kek

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

PAJEET NO

Truly street shitter-tier

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.

rare (((uguu)))

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

a good user experience is bloat

posts aren't made here often enough to care about having to press f5.
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

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.


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

i might go back to usenet at this rate

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

Have you tried the nntpchan?

What am I looking at?

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.

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

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.

wrong pic

It's shit.

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?

...

three times the gay

Come on guys....

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

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

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.

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

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

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.

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

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

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

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.

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.

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

Got a link?

not yet. soon though.

Looking forward to checking it out.

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

brainfuck is not blazingly fast and has not fearless concurrency

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

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

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.

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.

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

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.

why don't you post it?

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

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

...

That sounds like you don't have shit working.

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.

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.
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.
ghostbin.com/paste/br5s9

>>>/g/
Holla Forums has more than one board.

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

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

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.

stopped reading there
stop being such a nerd!

care more about bettering yourself than some dumb webpage

prioritize

...

How long have you been working on making this?

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

Did most of it last week though.

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

it's plain text in a cancerous font

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.

fuck i have that same shirt

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.

You just made my day with this.
Now I have a good excuse to kill myself.