Live data from Hacker News

Google Docs will now use canvas based rendering

workspaceupdates.googleblog.com

541–550 of 953 posts

Re: Google Docs will now use canvas based rendering

#541

Earlier quoted context omitted.

> The primary reason web apps are slow is because the business logic is typically un-optimized. This crops up a lot, shifting the blame from the web technologies to the developers who target those technologies, but where are the exceptions? What's the best example of a large, complex, efficient and responsive web-based application? It's easy to give examples of tragically inefficient and unresponsive web-based applic…

Figma is one of my favorite examples of something which is a nontrivial webapp that avoid feeling like a webapp a lot of the time, even when running in a browser instead of their Electron wrapper. But their technical leadership contains some of the (arguably) most accomplished folks working in the Javascript world these days, they might be an outlier in this area.

Figma is built in Web-Assembly (compiled from C++) [1] and Canvas, basically sidestepping the vast majority of the web stack. That's why it's fast.

[1]: https://www.figma.com/blog/webassembly-cut-figmas-load-time-...

Re: Google Docs will now use canvas based rendering

#542
post #366

Earlier quoted context omitted.

I personally didn't even bother checking out VS code because it was based on electron, and so I figured the performance just wouldn't be there because it's doing all of this awkward web stuff while trying to be an IDE. I was completely wrong though. Using it, it really doesn't feel like a web app at all. It's really shocking and impressive. It feels like a text editor. Perhaps I should learn more about what they're d…

The major problem I have with electron apps is that they eat memory for breakfast, lunch, and dinner. This happens with jvm applications as well, but you can limit the max heap size and force the garbage collector to work more, trading off speed for the ability to run more apps side by side. AFAIK, you can't limit the memory used in electron apps, and they don't respond by sharing heap with their child processes. Wit…

This isn't entirely the fault of Electron though, but the convenient data types exposed in a web environment. Beyond the baseline memory of running Chromium, you could use various tricks to keep memory very low such as minimizing GC (eg. declare variable up front, not within loops), use array buffers extensively, shared array buffers to share memory with workers, etc.

Re: Google Docs will now use canvas based rendering

#543
post #86

(googler, opinions are my own. I know nothing about this project). I really hope this fixes the large-document problem. As someone that has to deal with large specs (1000+ page MS Word documents), Google Docs does a not-so-great job of handling them. I also understand this is why many writers don't like Google Docs to write the entire book in, as things start slowing down when you get into the hundreds-of-pages. I do…

Sounds like your problem is the process that requires you to use 1000-page Word documents, not Google doc performance...

Regardless 1000 page documents _are_ the sort of things that full-fledged word processors should be able to support.

Writers need to write books, readers need to read books, and computers have more than enough resources to support these use cases.

Re: Google Docs will now use canvas based rendering

#544

Earlier quoted context omitted.

The copy and paste problem is sidestepped in android by the os native ocr, it might become common elsewhere too.

I can’t tell if you’re being facetious. Text is rendered to a canvas frame buffer and then the solution to text selection involves OCR?

I mean, that's how MacPaint was going to work. (They eventually ditched “edit text once it's written” entirely, for fear that people would use MacPaint for word processing, but the code was all written.)

Re: Google Docs will now use canvas based rendering

#545

Earlier quoted context omitted.

Switching to canvas sounds like a very roundabout way to handle an issue related to the dom growing out of hand. Surely unmounting pages that you you're not currently looking at should work? Of course there could be many reasons but we're left to speculate...

You can ditch the off-screen rendered pages but you are still stuck with the entire 1000-page data structure. Should your current line be on page 997 or 998? You have to calculate the size of every line of every page to answer that.

But does switching to using canvas solve that problem?

Re: Google Docs will now use canvas based rendering

#546

Earlier quoted context omitted.

Just loaded it and it ran awfully. We all have anecdotal experiences and it doesn’t make yours any less valid than mine but it does point out that they don’t show much besides what you personally experienced.

wdym by awfully? This makes me crazy, the gallery loaded instanltly, every item I click loads instantly, no problem with scrolling. There is a five second loading delay on the phone when the app loads, the items after that open just as fast as on the laptop. The only thing I saw that didn'r run smoothly on my weak phone is the flutter plasma demo[0], but it runs without any tearing on the laptop. [0] https://flutterp…

That doesn’t even load on my iPhone 12

Re: Google Docs will now use canvas based rendering

#547

Earlier quoted context omitted.

some of VS Code has been canvas-based since 2017 - https://code.visualstudio.com/blogs/2017/10/03/terminal-rend...

I stand corrected, seems like they’re using canvas for at least the integrated terminal and maybe (?) the editor. Makes all the more sense for Google Docs to follow suit. I’m not against apps moving entirely to canvas by the way, as long as the regular non-webapp sites don’t start doing this just because they can.

The editor is all DOM based apart from the minimap. More pixels could definitely be pushed faster by re-writing it in canvas but it would be quite the undertaking when you consider accessibility, backwards compatibility, monaco extensibility, etc. with the end result just being a improved scrolling experience.

Re: Google Docs will now use canvas based rendering

#549
post #349

Earlier quoted context omitted.

Does Google put ads on Google Docs? Anyway, adblockers that work at the network level should still work. This will make things more difficult for cosmetic removals though.

How will it work, if they are sending binary WASM blobs? This is akin to saying "pi hole can block ads in .exe files"

The question is, who is sending binary WASM blobs? That ad data needs to come from an ad server, and if network requests to the ad servers are blocked, the ads will not load.

Re: Google Docs will now use canvas based rendering

#550
post #304
post #41

https://github.com/myliang/x-spreadsheet

I don't understand why stupid people downvote my comment. I just posted a link. Why are you so dumb?

Your link was fine, and has since been upvoted (see https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sor...), but a comment like this one breaks the site guidelines. Would you mind reviewing them? https://news.ycombinator.com/newsguidelines.html

Edit: could you please stop posting unsubstantive comments generally? Your account has been doing a lot of that, and we're hoping for a little higher quality of discussion here.

Post reply on HN