Aws::Client::ClientConfiguration default construction is very slow #2397
Answered
by
jmklix
Gribouillages
asked this question in
Q&A
-
#include <aws/s3/S3Client.h>
#include <aws/core/Aws.h>
#include <aws/core/auth/AWSCredentialsProvider.h>
#include <iostream>
#include <ctime>
int main()
{
time_t start, end;
Aws::SDKOptions options;
options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace;
Aws::InitAPI(options);
start = clock();
Aws::Client::ClientConfiguration cfg; //4 ~ 6s
end = clock();
cfg.endpointOverride = "xx";
cfg.scheme = Aws::Http::Scheme::HTTP;
cfg.verifySSL = false;
cfg.region = "xx";
Aws::Auth::AWSCredentials cred("xxxx", "xxxx");
auto client = std::make_shared<Aws::S3::S3Client>(cred, cfg,
Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never, false);
std::cout << (end-start) << std::endl;
Aws::ShutdownAPI(options);
} |
Beta Was this translation helpful? Give feedback.
Answered by
jmklix
Mar 21, 2023
Replies: 2 comments
-
I see that this is closed, but please make sure you are using the sdk correctly by adding the sdk call in curly brackets: #include <aws/core/Aws.h>
int main(int argc, char** argv)
{
Aws::SDKOptions options;
Aws::InitAPI(options);
{
// make your SDK calls here.
}
Aws::ShutdownAPI(options);
return 0;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bhavya2109sharma
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see that this is closed, but please make sure you are using the sdk correctly by adding the sdk call in curly brackets: