On Wed, Oct 8, 2014 at 6:13 PM, Colin Jenkins <[email protected]> wrote:
> Hi, > > Apologies for the basic nature of these questions. I feel pretty stupid > asking, but I can't find the answer anywhere... > > I've written a chess engine in Javascript and am pleased with the initial > (not-thought-about) performance; in play, on my fairly old machine it's > analysing about 500,000 nodes/sec and when testing the move generator, it > gets up to an order of magnitude more than that. > > http://op12no2.me/toys/lozza/play.htm > > I use a lot of globals, e.g. right at the top scope will be something > like:- > > var QUEEN_VALUE = 975; > > Does V8 optimise references to globals? > Yes. Make sure they're only assigned once. > I have a lot of them and recursion depths can get quite deep. > > if I used:- > > const QUEEN_VALUE = 975; > > Would V8 inline the literal value of 975? I've tried using const, but > performance drops dramatically, which I find a bit odd; I'm obviously not > understanding something. > In a quick test I don't see any difference in support for "const" vs. "var". Both should get inlined into optimized code. > And last question: is there a bleeding-edge Chrome browser download that > always has a very modern V8 engine embedded in it available anywhere? > Sure, there's the Stable channel (new "milestone" every ~six weeks), the Beta channel (typically one milestone ahead of stable), the Dev channel (~weekly development snapshots of what will become the next milestone to go on Beta), and on Mac and Windows there's the Canary channel (updated daily). So all channels are "very modern"; bear in mind that Dev/Canary can be quite a bit more crashy (as well as slower) than Beta/Stable. -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
