
V8 release v6.8 - stablemap
https://v8project.blogspot.com/2018/06/v8-release-68.html
======
heydenberk
> The optimizing compiler did not generate ideal code for array destructuring.
> For example, swapping variables using [a, b] = [b, a] used to be twice as
> slow as const tmp = a; a = b; b = tmp. Once we unblocked escape analysis to
> eliminate all temporary allocation, array destructuring with a temporary
> array is as fast as a sequence of assignments.

I enjoy seeing updates like this to learn more about how the engine works,
but: these changes are exactly the reason you _don't_ want to design your code
around specific micro-optimizations, particularly when it comes to JS. They're
at parity now and it is quite possible that 6 or 12 or 24 weeks from now, the
cleaner destructuring approach will actually be faster than the tmp-var
approach. Remember this the next time someone suggests in code review that you
should design your code to meet the whims of the JS engine.

~~~
jazoom
I'd have to be running that billions of times a day before I'd start to care
about the extra nanoseconds. Clean-looking code makes me feel better than
having my servers sit at 67.3% CPU instead of 67.4% CPU.

~~~
williamdclt
I'd take cleaner code for half the speed quite often!

~~~
neuland
I see that you too are a Python developer! /s

~~~
kungito
How is a language which doesn't have a type checker a synonym for clean code?

~~~
fulafel
Python does a lot of type checking and complains loudly, very different from
eg Javascript.

~~~
coldtea
Besides, whether it complains or not about misused types, says nothing about
the code being clean or not.

One can write totally unreadable code in Scala and a totally readable version
of the same algorithm in Python if one so wishes.

------
bitcraft
Very excited to see more improvements with V8. I am worried however about how
good google chrome is and how it completely dominates in some markets. I hope
that Firefox can continue to improve (Quamtum is great!) and stay relevant
especially since Electron Apps are popular and it’s not certain that some day
they won’t include Google telemetry.

~~~
jazoom
Chakra seems decent too. And aren't V8 and Chakra both open source? Does
Google improving V8 increase the size of their moat?

V8 improvements also benefit NodeJS, and they also contribute to it, I think.

I use both Chrome and NodeJS and will take any speed improvements they make.

~~~
duhi88
It certainly increases the size of their influence.

------
rptv
I want to see something like Flow integrated into the js specs. Types can help
optimization just as they can help correctness!

~~~
rictic
Possibly! But trickier than it seems at first.

For types to help with optimization, those types have to be correct and
reliable (i.e. sound). If every line of your app and all of its dependencies
are sound, then you should expect a speedup. If there is any unsound code,
then you'll have to generate runtime checks to preserve the soundness
properties that your optimizer assumes, and those can actually result in
_slower_ code.

Even Flow has made compromises that are good for a type checker, but likely
unacceptable if an optimizer is relying on them. Quoting
[https://flow.org/en/docs/lang/types-and-
expressions/](https://flow.org/en/docs/lang/types-and-expressions/)

> Soundness is fine as long as Flow isn’t being too noisy and preventing you
> from being productive. Sometimes when soundness would get in your way too
> much, Flow will favor completeness instead. There’s only a handful of cases
> where Flow does this.

------
samueldavid
i like the improvements made to typed array sorting

------
wpdev_63
I can't wait for web assembly to get direct access to dom. Javascript cannot
be gone soon enough.

~~~
imjasonmiller
Wouldn’t a UI in WebAssembly make it impossible to block ads? The recent QT
announcement renders to Canvas doesn’t it?

I thought the idea was to mostly use WebAssembly for parts that are
performance critical, not replace all of it?

~~~
shawnz
This has always been possible if you just write sufficiently obfuscated
JavaScript. However a UI that is entirely rendered in a canvas element would
basically be unusable by anyone with a disability, so that technique is
useless for big orgs.

~~~
gnode
The cynic in me can't help but expect most web companies to care more about
pushing unblockable ads down everyone's throats than about the disabled.

~~~
acdha
That’s why decent countries have regulation to make them care about things
other than short-term profit.

