문제

I'm developing a C++ application which needs to connect to MySQL server for some information but my app doesn't run queries frequently. So As C++ connector uses C API behind the scenes... I got this doubt.I'm in dilemma whether to go with C API or C++ API??

도움이 되었습니까?

해결책

From my experience it doesn't make that much of a difference. The C++ API just wraps the C API – so you're left with an additional function call using the C++ API. Most of the time the compiler can optimize that out and a function call does not have a real perceivable overhead.

다른 팁

Compared to the millions of clock cycles that even the smallest database query requires, a wrapper around a few C functions is not going to make the least difference.

You're writing an app in C++. There's a C++ wrapper for MYSQL. Just use it.

Performance is very unlikely to be an issue, but if it does become so in the future you can address it then. Keep it simple.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top