Skip to content

Commit c8e8f28

Browse files
authoredSep 9, 2024··
feat(endpoints): codegen sync for request creation performance improvements (#6449)
* feat(middleware-endpoints): update codegen version for request creation performance improvements * chore: update smithy hash * chore: codegen sync * chore: update yarn lock * test: update client maximal config * test(lib-dynamodb): throw error for cacheMiddleware=true * fix(endpoints): avoid mutation of cached endpoint
1 parent 7a0c615 commit c8e8f28

File tree

910 files changed

+13727
-16244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

910 files changed

+13727
-16244
lines changed
 

‎clients/client-accessanalyzer/package.json

+21-21
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,30 @@
3333
"@aws-sdk/util-endpoints": "*",
3434
"@aws-sdk/util-user-agent-browser": "*",
3535
"@aws-sdk/util-user-agent-node": "*",
36-
"@smithy/config-resolver": "^3.0.5",
37-
"@smithy/core": "^2.4.0",
38-
"@smithy/fetch-http-handler": "^3.2.4",
39-
"@smithy/hash-node": "^3.0.3",
40-
"@smithy/invalid-dependency": "^3.0.3",
41-
"@smithy/middleware-content-length": "^3.0.5",
42-
"@smithy/middleware-endpoint": "^3.1.0",
43-
"@smithy/middleware-retry": "^3.0.15",
44-
"@smithy/middleware-serde": "^3.0.3",
45-
"@smithy/middleware-stack": "^3.0.3",
46-
"@smithy/node-config-provider": "^3.1.4",
47-
"@smithy/node-http-handler": "^3.1.4",
48-
"@smithy/protocol-http": "^4.1.0",
49-
"@smithy/smithy-client": "^3.2.0",
50-
"@smithy/types": "^3.3.0",
51-
"@smithy/url-parser": "^3.0.3",
36+
"@smithy/config-resolver": "^3.0.6",
37+
"@smithy/core": "^2.4.1",
38+
"@smithy/fetch-http-handler": "^3.2.5",
39+
"@smithy/hash-node": "^3.0.4",
40+
"@smithy/invalid-dependency": "^3.0.4",
41+
"@smithy/middleware-content-length": "^3.0.6",
42+
"@smithy/middleware-endpoint": "^3.1.1",
43+
"@smithy/middleware-retry": "^3.0.16",
44+
"@smithy/middleware-serde": "^3.0.4",
45+
"@smithy/middleware-stack": "^3.0.4",
46+
"@smithy/node-config-provider": "^3.1.5",
47+
"@smithy/node-http-handler": "^3.2.0",
48+
"@smithy/protocol-http": "^4.1.1",
49+
"@smithy/smithy-client": "^3.3.0",
50+
"@smithy/types": "^3.4.0",
51+
"@smithy/url-parser": "^3.0.4",
5252
"@smithy/util-base64": "^3.0.0",
5353
"@smithy/util-body-length-browser": "^3.0.0",
5454
"@smithy/util-body-length-node": "^3.0.0",
55-
"@smithy/util-defaults-mode-browser": "^3.0.15",
56-
"@smithy/util-defaults-mode-node": "^3.0.15",
57-
"@smithy/util-endpoints": "^2.0.5",
58-
"@smithy/util-middleware": "^3.0.3",
59-
"@smithy/util-retry": "^3.0.3",
55+
"@smithy/util-defaults-mode-browser": "^3.0.16",
56+
"@smithy/util-defaults-mode-node": "^3.0.16",
57+
"@smithy/util-endpoints": "^2.1.0",
58+
"@smithy/util-middleware": "^3.0.4",
59+
"@smithy/util-retry": "^3.0.4",
6060
"@smithy/util-utf8": "^3.0.0",
6161
"tslib": "^2.6.2",
6262
"uuid": "^9.0.1"
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
// smithy-typescript generated code
22
import { awsEndpointFunctions } from "@aws-sdk/util-endpoints";
33
import { EndpointV2, Logger } from "@smithy/types";
4-
import { customEndpointFunctions, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints";
4+
import { customEndpointFunctions, EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints";
55

66
import { EndpointParameters } from "./EndpointParameters";
77
import { ruleSet } from "./ruleset";
88

9+
const cache = new EndpointCache({
10+
size: 50,
11+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
12+
});
13+
914
export const defaultEndpointResolver = (
1015
endpointParams: EndpointParameters,
1116
context: { logger?: Logger } = {}
1217
): EndpointV2 => {
13-
return resolveEndpoint(ruleSet, {
14-
endpointParams: endpointParams as EndpointParams,
15-
logger: context.logger,
16-
});
18+
return cache.get(endpointParams as EndpointParams, () =>
19+
resolveEndpoint(ruleSet, {
20+
endpointParams: endpointParams as EndpointParams,
21+
logger: context.logger,
22+
})
23+
);
1724
};
1825

1926
customEndpointFunctions.aws = awsEndpointFunctions;

0 commit comments

Comments
 (0)
Please sign in to comment.