One of the things that we can do is generate morethan one version of code, so we can generate an optimized version of codes that’s goingto be really fast. And then, if we hit something that the fast version of the code cannot handle,we can bail out and generate a slower version of the code that can handle all of the specialcases. So that’s one of the things we’re working on. Another thing that we’re working on isredesigning our snapshotting mechanism. So, we have a snapshotting mechanism in V8 thatallows us to take parts of the heap and put it in a binary format that we can use forother instances of V8.
So, we try to generalize that so we can do more with that. So, oneof the things that we’re trying to do right now is generalize the snapshotting mechanismso that more of the work that V8 has to do on start-up can be stored in snapshot, thenwe just load, which gives us more instant start-up. We’re also just doing, like, tuningof the existing system.
There are always things to improve. So, one of the things that we’rereal looking at, currently, as well is to make the transition between our generatedcode, which is running most of the time, and the run time system faster. So, if there’ssomething that our generated machine code cannot handle, we transition to the runtimesystem. And right now, that’s fairly heavy and we can make that lighter which will increaseperformance as well.
So, I justsaid that we’re implementing a new one again and we are, because we did get even better.But we already did re-implement the compiler once to get a registered allocation, whichhelps for performance. In the compiler, we also did more in-lining, which improves propertyaccess speed. We also implemented a new regular expression engine completely from scratch.What we had before was not very good for V8’s purposes.
It didn’t fit our model very well.So, we decided to design and implement our own Java–sorry, regular expression engine.And that gave a noticeable boost in performance as well. It gave, like, a factor of 10 onregular expression execution performance. So, those are some of the things that we’redoing. And then, we’re just doing, as I said before, tuning at the existing system.So, we’re just profiling the system in different–on the different working conditions and findingbottlenecks, and making sure to get rid of them.
So, some of the things that we’vedone is avoiding allocations and–like delaying allocations of objects until we actually needthem. Where sometimes we would allocate objects upfront where we really didn’t have to.So, stuff like that. Just, like, tuning the system, finding bottlenecks, doing, yeah,doing tuning. Removing some operations that are not needed in the common case and onlydo those separations if we hit an oncoming case. Benchmarks are important. They’re veryhot to come up with because you want something that makes sense.
So, we’re measuring ourselves against pretty much anything that we can find, because measuring ourselves, again,as much as possible is good for us, because we find trouble spots in V8. We find placeswhere we can do better and we can work on those. And also having as many benchmarksas possible is good for the user, right?