10 ms·
Maybe I'm missing it, but it says it was originally twice as slow as JS, than it says they did optimizations, then no comparison on the final outcome?
by markdog12 2y ago
Maybe I'm missing it, but it says it was originally twice as slow as JS, than it says they did optimizations, then no comparison on the final outcome?
- tjlav5 2y agoAh same thought exactly
- giovannibonetti 2y agoMaybe the numbers didn't look very good and they thought it was better to leave them out
- ksec 2y agoBut then what is the point telling us they are doing it with WASM now? Seems more like a KPI - Work Progress report. Edit: In a different blog post : https://workspace.google.com/blog/sheets/new-innovations-in-google-sheets https://workspace.google.com/blog/sheets/new-innovations-in-... "Building on improvements like smooth scrolling and expanded cell limits in Sheets, today we’re announcing that we’ve doubled the speed of calculation in Sheets on Google Chrome and Microsoft Edge browsers,"... I dont use Google Sheet but I wonder how far apart are their new implementation compared to Native Microsoft Excel.
- cm2187 2y agoI don't know if native excel should be the benchmark. It seems to me that it has been ever slower over excel versions.
- PaulHoule 2y agoOne trouble with Excel is that it does an awful lot of different things but doesn’t do them well. If you try do use it to do what Pandas does it is shocking how small of a data file will break it. The idea of incremental calculation of formulas that don’t need to be put in a particular order is still genius but the grid is so Apple ][. Maybe the world doesn’t know it because it spurned XBRL but accounting is fundamentally hyper dimensional (sales of items > $100 in the afternoon on the third week of February in stores in neighborhoods that have > 20% black people broken down but department…) not 2-d or 3-d. Having the wrong data structures is another form of “garbage in garbage out”. I have though many times about Excel-killers, trouble is they have to be something new, different and probably specialized, people know how to get answers with Excel even if they are wrong, plus Excel is bundled with the less offensive Word and Powerpoint so a lot of people are paying for it either way. Personally I want a spreadsheet that does decimal math even if there is no hardware support except on mainframes: I think a lot of people see 0.1 + 0.2 |= 0.3 and decide computers aren’t for them.
- wood-porch 2y agoGoogle sheets does do decimal math so I'm not sure what you mean
- PaulHoule 2y agoIt doesn’t use ordinary floats?
- wood-porch 2y agoUnless my test methodology was flawed: Displays 0.3: "=0.1+0.2" Displays 3E+79: "=(0.1+0.2)*1e80"
- csande17 2y agoTry "=((0.1+0.2)-0.3)*1e80" -- your test can be fooled by pretty standard rounding for display.
- wood-porch 2y agoOops -- nice, thank you! Sorry, guess I was mistaken
- mkl 2y agoThat could be just the way it's displaying, e.g. to 14sf or something. If you try adding a million 0.1s and use a formula to compare to 100,000, that might tell you (with floats I got 100000.00000133288). This question suggests it uses floats: https://stackoverflow.com/questions/74542790/google-sheet-yields-infinitesimal-number-as-remainder-of-an-integer-whole-number https://stackoverflow.com/questions/74542790/google-sheet-yi...
- emeril 2y agomaybe try rowzero.io as at least a remotely calculated alternative? I live in excel sadly and it's all been downhill since excel 2003 as for better math calcs, yeah excel isn't perfect for true accuracy of decimal math but that rarely matters in 99.99% of use cases - if you need really accurate math you use R/Python/etc. if you need something for the masses, visicalc/lotus/excel is the solution
- azakai 2y agoThe two posts make the most sense together, yeah. I was involved in this work (happy to answer any questions). Overall we started from a large slowdown compared to JS, worked hard, and ended up with a large speedup over JS of around 2x. So right now it is a big improvement over JS. That improvement required work across the codebase, the toolchain, and the VM. Most of it is not specific to Java and also helps other WasmGC projects too (like Dart and Kotlin). We are also working on further improvements right now that should make things even faster.
- tomrod 2y agoWell done on the accomplishment -- no small feat to improve runtime 50% in a mature codebase. I'm interested more in learning how to work within wasmgc. Do you have any resources you'd point to for someone looking to pick it up?
- azakai 2y agoThis post might help: https://v8.dev/blog/wasm-gc-porting https://v8.dev/blog/wasm-gc-porting See in particular the "getting started" section near the end: https://v8.dev/blog/wasm-gc-porting#getting-started https://v8.dev/blog/wasm-gc-porting#getting-started At a lower level the overview in the WasmGC github repo is very good: https://github.com/WebAssembly/gc/blob/main/proposals/gc/Overview.md https://github.com/WebAssembly/gc/blob/main/proposals/gc/Ove...
- lukan 2y agoOh, you were involved as well. Well then, no wonder things worked out! (I remember you from your work with asm and emscripten and the various ports you did, which I played around with) No specific question(right now), I just want to say, I admire your work.
- azakai 2y agoOh, thanks! Yeah, I was involved here on the toolchain side. We did a lot of work on the Binaryen optimizer for WasmGC.
- michaelothomas 2y agoI don't know absolute values but Excel still has several advantages which make it faster: - Excel is written in C++ and compiled natively which will be a bit faster than Java running on the JVM. And Java running as WasmGC is about 2x slower than Java on the JVM. - Sheets is limited to 4GB of RAM by the browser, Excel isn't. - C++ can do shared memory multi-threading, WasmGC cannot.
- tomComb 2y agoNot sure why you’re comparing the c++ Excel to the browser version of sheets. It would make more sense to compare the native version of Excel to the native versions of sheets, ie. android iOS and chromeOS, and the browser sheets to the browser excel.
- adrianmonk 2y agoBecause they're replying to someone who wondered about the performance "compared to Native Microsoft Excel". I'll add that browser Google Sheets and native Microsoft Excel are the fastest versions available (of each product).
- tomComb 2y agoWhy do you suggest that the web version of sheets is faster than the swift or Java versions? I haven’t tried them, and certainly haven’t benchmarked them, but I would imagine they’re faster.
- ehsankia 2y agoI don't think there is a native desktop version of sheets? On ChromeOS, it's running the web version. But yes I'd be curious to see how the web version of Excel does it.
- tomComb 2y agoThere is a version of sheets in both App Stores and I believe you can run the android version on chrome OS
- txdv 2y agoYeah, I did not enjoy that part, it was basically an abrubt stop. It also sounded that they were compiling java to js and afterwards to wasm, I would like to know what engine they are using.
- azakai 2y agoThe compiler from Java to JS is J2CL: https://github.com/google/j2cl/ https://github.com/google/j2cl/ And that now includes a Java to WasmGC compiler, called J2Wasm: https://github.com/google/j2cl/blob/master/docs/getting-started-j2wasm.md https://github.com/google/j2cl/blob/master/docs/getting-star...
- Mathnerd314 2y agoI have tried using Google Sheets for large calculations, with even a few thousand rows it is much slower than say LibreOffice (instant vs. progress bar) Although maybe the WASM thing was not working.
- shiandow 2y agoNot surprising, google apps regularly seem to be slow to respond when I just type stuff.
- p_j_w 2y ago>Although maybe the WASM thing was not working. They only made these changes yesterday.
- nradov 2y agoSometimes Google Sheets isn't just slow, it completely chokes and hangs on large spreadsheets with thousands of rows containing complex formulas. Excel handles the same spreadsheets fast and reliably.
- dylan604 2y ago[flagged]
- danielvaughn 2y agoI'm surprised it was twice as slow. Just this past week I was playing around with WASM, running some pure math calculations and comparing them against a JS version. I was seeing a 10x perf increase, though I was writing WAT directly, not compiling C or anything like that.
- lukan 2y agoWell, they give some reasons: "For example, they had a core data structure in Sheets which was blurring the lines between arrays and maps. This is efficient in JavaScript, which automatically models sparse arrays as maps, but slow on other platforms. "" "Of the optimizations they found, a few categories emerged: Replicating core optimizations that already existed in the Java Virtual Machine (JVM) and in V8. Using highly optimized browser APIs. Removing JavaScript-specific coding patterns" Basically it seems, they tried to copy their js code. And this unsurprisingly did not work out well. They had to reimplement some critical parts.
- ruds 2y agoNote -- AIUI the js and wasmgc are both produced from the same Java codebase. The problem here is that the developers on the Java codebase had started making changes based on their performance when transpiled to javascript (which is only natural -- it seems that they had been targeting js output for a decade).
- cogman10 2y agoI don't think that was the only issue. For example, they point out that they got 40% improvement by adding devirtualization to the compiler. Java by its nature likes to add a whole bunch of virtual method calls. Java devs primarily rely on the JIT to fix that up (and it works pretty well). Javascript relies similarly on that sort of optimization. WASM, on the other hand, was built first to compile C/C++/Rust code which frequently avoids (or compiles away when it can) virtual method calls. I imagine this isn't the only issue. For example, I'll guess that dealing with boxing/unboxing of things also introduces a headache that wouldn't be present in similar C/C++ code. In short, it just so happens that a lot of the optimizations which benefit JS also benefit Java. The one example where they did a Javascript optimization was prefering Maps and Lists over PoJos.
- michaelothomas 2y agoThe WasmGC version is twice as fast as the JS version.
- leonardinius 2y agoInitial Js version approx 1/3 of jvm; wasm gc is 2/3 of jvm speed then?
- azakai 2y agoAdding a comment here to note that the post was just updated to clarify that: https://web.dev/case-studies/google-sheets-wasmgc#the_final_result https://web.dev/case-studies/google-sheets-wasmgc#the_final_... > The final result > After all these optimizations, the final WasmGC version of Sheets achieves a calculation performance approximately twice as fast as JavaScript, representing a fourfold improvement from the starting point of the initial WasmGC version.
- cxr 2y agoAnd by "the JS version", you mean the Java version—compiled to run in the browser by targeting its JS engine. There is no JavaScript version. This is a consistent mistake made throughout your article. It's not an especially rigorous or intellectually honest article. It's a good example of how software development differs from other disciplines. The sleights of hand used in this piece are something that ideally would be rooted out in peer review. You're comparing JVM bytecode as a compilation target for Java programs vs using JS as an alternative bytecode for Java programs. Unsurprisingly, the former wins. Who knew.
- bedatadriven 2y agoThe primary point of the article is to compare two compilation targets for a single codebase: JS and WasmGC. It's an extremely timely and interesting topic. The performance of a third compilation target - JVM bytecode provides a useful baseline.
- cxr 2y ago