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??
Asked
Active
Viewed 1,233 times
1
-
5IF doesnt run frequently what is purpose of this question? – Denis Ermolin Oct 29 '12 at 11:48
-
@Denis I need to connect to it for getting some configuration params and starting and stopping of slave, for list of DBs and their props etc.. – Sreekar Oct 29 '12 at 11:59
3 Answers
6
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.

muehlbau
- 1,897
- 13
- 23
1
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.

jalf
- 243,077
- 51
- 345
- 550
0
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.

Component 10
- 10,247
- 7
- 47
- 64