phpv8 / php-v8

PHP extension for V8 JavaScript engine
https://php-v8.readthedocs.io
MIT License
217 stars 14 forks source link

Add a way to optimize operations that require Context and Isoalte been entered #74

Closed pinepain closed 7 years ago

pinepain commented 7 years ago

Entering already entered Isolate and/or Context is much cheaper, (200% cheaper). Before that we used to wrap a code that did intensive entering and leaving into FunctionObject callback, which is also overhead and dirty hack. With something like Isolate::withing(callable $callback) and Context::withing(callable $callback) it should be more straightforward and much cleaner to let users to do potential optimizations.