belgattitude / soluble-japha

PHP Java integration
https://belgattitude.github.io/soluble-japha/
MIT License
69 stars 15 forks source link

HHVM native parser enhancement, xmlreader extension #1

Closed belgattitude closed 7 years ago

belgattitude commented 9 years ago

The Soluble\Java\Bridge\Driver\Pjb62\NativeParser class does not work with HHVM due to differences in xmlreader extension.

Currently a hack is made the class Soluble\Java\Bridge\Driver\Pjb62\Parser.php in order to fallback to the SimpleParser pure php implementation.

A fix to this feature allows deeper rafactoring (removal of the the Soluble\Java\Bridge\Driver\Pjb62\Parser.php class and direct access to NativeParser).

tholu commented 7 years ago

I think this is related to: https://github.com/facebook/hhvm/issues/1391 (libexpat vs libxml2)

belgattitude commented 7 years ago

Hi @tholu thanks for pointing out.

There won't be a quick fix for that I guess.

Looks falling back to the "pure-php" parser quirk is good for now. Unit tests pass on hhvm, but I have no idea of the performance gain we could have by using a native parser. The only benchmarks I have are related to the unit test suite (without xdebug) :

hhvm ./vendor/bin/phpunit
# ...
Time: 4.6 seconds, Memory: 549.44MB
OK, but incomplete, skipped, or risky tests!
Tests: 76, Assertions: 683, Skipped: 2.

against php7.1

php7.1 ./vendor/bin/phpunit
# ...
Time: 872 ms, Memory: 216.47MB
OK, but incomplete, skipped, or risky tests!
Tests: 76, Assertions: 682, Skipped: 2.

Of course running phpunit with hhvm (cli) cannot be compared.... Loading is always slower.

So for now, I'll close the issue, feel free to reopen if you have an idea.

Out of curiosity, are you using hhvm ?

tholu commented 7 years ago

I wanted to use phpJavaBridge with HHVM, but because of the issue linked above I couldn't. I yesterday found your project here and will try it as soon I find some time.

belgattitude commented 7 years ago

Yes seems the way to go... Original Java.inc client is too outdated.

belgattitude commented 7 years ago

For your info, because it's not yet fully documented...

I'm currently releasing a fork of php-java-bridge server as well (client work was needed before). Could be interesting to note those projects:

https://github.com/belgattitude/pjb-starter-gradle

and

https://github.com/belgattitude/php-java-bridge

tholu commented 7 years ago

Thank you, I already starred both!