-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slower then mongo-php-driver-legacy? #138
Comments
use the same db, mongodb 3.0. |
I'm also blocked by Mongo in my path to upgrade PHP 7.0. Not only do things like this post concern me, but also migrating will be a tremendous task for us since every simple operation from insert, update to commands all need to change. I know this new driver will be ideal someday, but in the mean time, what is the core reason for why the old Mongo driver cannot be made to work in PHP 7? |
@tpneumat |
@IMlcl: Can you share the code (and data fixtures) you're using to obtain these measurements? I don't see this represented in the profiling graphic you shared. There is going to be overhead to this userland library (vs. using the legacy In the profiling data you've shared, the many You can disable this behavior via the
@tpneumat: If the API changes are a problem, you may be interested in alcaeus/mongo-php-adapter, which implements the
Porting the legacy extension to PHP 7 and HHVM, which was also a target for us, would have required considerable resources, and the maintenance burden going forward would have been even greater. This was a ripe time to essentially bump major versions and revise the API without carrying over various design mistakes from |
@jmikola Thank you very much. Yes, I add I rewrite some codes, upgrade to mongodb 1.1.5, here is the performance: Slightly slower than ext mongo, I think it is ok. |
Offhand, was the "ext mongodb" test using both the extension and this library, or just the extension API directly? We do have a tracking ticket to benchmark the new driver against the legacy one PHPC-286. I've cross-linked this issue so we can reference it down the line when we get around to creating those tests. |
Yes, |
Interesting topic. I migrated my app from using the old extension to the new ext + library and noticed a similar performance drop. In php 5.6 it was about 20-30% slower in requests per second. Using PHP 7 it was almost similar to the old driver, still slower. It feels like a loss, migrating to PHP 7 + new extension. The overhead seems to be quite huge. Was hoping for performance improvement. I have to exactly pin point where the slowness is coming from, might even consider just implementing the bare driver instead of using the library. |
Indeed interesting. |
php-mongo-adapter is up to 3x slower than legacy driver. If you upgrade PHP5.6 to PHP7 you will have less memory consumption but higher load times. I'm looking forward to see MongoDB ODM in action to get rid of the adapter. |
Upgrade PHP to 7.0, ext
mongo
can't work, so I change it tomongodb
+mongo-php-library
.And I found db operations seem slower than the legacy version
mongo-php-driver-legacy
.calling
find
method:PHP 5: 365ms
PHP 7: 922ms
Is it any issue about this library? or
mongo-php-dirver
?Regards
The text was updated successfully, but these errors were encountered: