Trucchi: yeah, v8 needs to.

 
Lecznar: Yamasaki: but well, you can do PGO instead of programmer hints.

Faille: The only drawback of PGO is that it doesn’t adapt to new wo***oads. So, it’s best if you know exactly how your application is going to execute AOT

Trucchi: Also, JIT isn’t an exact science and you’re going to run into walls compared to something like C++, which as previously mentioned can be written with perf in mind

Trucchi: Which much greater control than a language like Java

Yamasaki: Is there any jit atm that actually remembers profiles?

Doud: Either way, lack of control over memory layout and access is probably the single biggest thing that makes java, javascript, etc.

Moron: Branch mispredictions are like 20 cycles

Morles: Cache misses are like 300

Kostich: Tcsc: yeah, that’s a huge problem

Trucchi: Right. makes them more forgiving, but limits perf

Kane: The optimizer works on like, the 10% of performance that’s left over after the cache misses

Trucchi: The flipside being, that isn’t always easy to do by hand either

Rosol: No, and c++ doesn’t help you out here much

Izquierdo: But it’s much more feasible

Trucchi: Yeah, you can usually ballpark it at the cost of giving yourself a ceiling

Ingerson: It’s really tedious to do in JS and probably java too, although I’m not really super familiar with java

Trucchi: GC makes it a lot harder to control in general

Cavness: Well, C++ at least lets you design your memory layout.

Lertora: The way you manage it in js is with typed arrays

Whidden: Which makes it possible to design efficient data structures

Irimata: You also don’t need to store a tag word with each value 😀

Trucchi: Plus there’s all the little hacks you can do with references vs array indexes and whatnot

Yamasaki: The jvm would store a 8byte monitor variable with each variable :

Yamasaki: So you could do synchronizedsomwobject { only one thread at a time }

Talerico: And in c++ you can mitigate the language not helping out with techniques like data oriented design which still works in JS, but requires using lot of typed arrays and can hurt readability.

Trucchi: Point being: Java is fast for what it is, but it isn’t the right tool for the job if you need to optimize speed over all else

Panuccio: Js isn’t either, obviously, but the current state of asm.js is fairly pathetic

Eakes: Synchronized is such a bad idea :/

Ector: I mean, yes, it allows you to manage access to things. But it takes away concurrency from you. Which is like. really

Yamasaki: Does the js vm store an 8 byte type id for each variable?

Yamasaki: Didn’t someone say today that js is untyped? :

Trucchi: Anyway, theory aside, IIRC v8 still beats hot nashorn by factors ranging from 10% to 300%

Yamasaki: Dekok: well, js doesn’t have any threads in most all? implementations.

Dawber: Yamasaki: boxed values probably have a tag and cl*** stored with the value. Primitives that are guaranteed to be the correct type are probably stored unboxed

Manny: Hi, how can i select the nth children of an element?

Birkland: Twirl: element.childrennth?

Trucchi: Yamasaki: well the LANGUAGE is untyped in that you can store anything in any container unless you put restrictions on it yourself 😛

Ploss: Twirl: but what are you doing?

Eastmond: You can still have tags on the value. Some people call tags “runtime types” or “value types” or just “types”.

Trucchi: And the v8 JIT takes that to the next lvel

Trucchi: With hidden cl***es and things

Ladabouche: It’s weird to call tags that because there are things like dependently typed languages, where those terms make more sense

Rerucha: Trucchi: yeah, v8 needs to keep track of quite a few things