Coder Social home page Coder Social logo

Comments (5)

kelunik avatar kelunik commented on July 20, 2024

Please try opening a single connection instead of creating a new pool and closing it each time. I expect it to be a bit slower, but we should investigate what makes it that much slower.

from mysql.

mvorisek avatar mvorisek commented on July 20, 2024

FYI, without a pool ($db = yield \Amp\Mysql\connect(\Amp\Mysql\ConnectionConfig::fromString(...));) it is a little faster, but still very slow. I run is several times and I cannot get under 20s / 1000 iters.

from mysql.

kelunik avatar kelunik commented on July 20, 2024

I think this is probably mainly caused by PDO using the old mysql_native_password, while amphp/mysql supports the newer caching_sha2_password pluggable authentication. caching_sha2_password however, comes with quite some cost, because the client needs to fetch the server's public key and computed openssl_public_encrypt (which takes about 13% in my benchmark).

from mysql.

kelunik avatar kelunik commented on July 20, 2024

@mvorisek Turns out there was a bug in the caching_sha2_password implementation, which made it always to a full authentication roundtrip instead of using the fast auth flow.

I'm at 3s for 1000 iterations now instead of 7s with a local mysql docker container.

from mysql.

mvorisek avatar mvorisek commented on July 20, 2024

@kelunik nice finding, thank you ❤️

from mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.