Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why browsers are bloated

Name: Anonymous 2014-07-27 0:20

https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/Scrollbar.cpp
https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/win/ScrollbarThemeWin.cpp
Let's reinvent the fucking scrollbar, which every goddamn platform with a UI already has, and make it behave subtly different from the native one!

Right-click a native scrollbar in some other app:
- Scroll Here
- Top
- Bottom
- Page Up
- Page Down
- Scroll Up
- Scroll Down

Right-click a scrollbar in Chrome:
- Back
- Forward
- Reload
- Save As...
...

Right-click a scrollbar in Firefox and Opera:
Absolutely fucking nothing happens!

What the fuck!? How did these terminally retarded idiots get involved in creating one of the most important pieces of software to the average user?

Name: Cudder !MhMRSATORI 2014-09-06 10:52

After some more benchmarking, I've determined that just inserting nodes into the Win32 TreeView is taking up quite a significant portion of the time... with the same ~1MB file as before:

Tokeniser + Parser: 168ms-170ms (5.9-6.0MB/s)
Tokeniser + Parser, text only: 24ms (41.4MB/s)
Tokeniser + Parser - TreeView updates: 70ms (14.3MB/s)

59% of the time is spent in UI code, meaning the actual parser/DOM node creation is now over 4x faster than that of Chrome.

>>145
That's the whole point... lengths are stored so there shouldn't ever be a need to count, except when e.g. parsing things.

Further extension of the length-delimited string idea: at -4 from the pointer is the strlen, and at -8 is stored the allocated size, meaning I now get resizeable buffers (RBS) that are also downward-read-compatible with APIs expecting LDS and NTS. It's like an OOP class hierarchy, except without the bloat: RBS > LDS > NTS

>>146
Only if you're illiterate. The code actually looks far nicer in Asm than in C, because there's no type system that gets in the way; a ldstrlen() becomes a simple mov eax, [eax-4]. An rbldstrcat() looks like this:

char *rbldstrcat(char *rbs, char *lds) {
long rbsl = LDSTRLEN(rbs);
long ldsl = LDSTRLEN(lds);
rbs = rbs_append_size(rbs, ldsl);
memcpy(rbs + rbsl, lds, ldsl + 1);
LDSTRLEN(rbs) += ldsl;
return rbs;
}


Very similar to Delphi strings - too bad Delphi's compiler is terminally retarded (http://dis.4chan.org/read/prog/1318534478 )... MFC has CString which is similar, but they also put the fields in the wrong order so that LDS aren't compatible with them.

Newer Posts