-
Notifications
You must be signed in to change notification settings - Fork 621
Closed
Labels
bugThis issue is a bug.This issue is a bug.p1This is a high priority issueThis is a high priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlog
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
After migrating from v2 to v3 I've noticed slowdown of one of our metrics.
Importing dynamodb client affects parsing of html files.
What exactly aws sdk v3 does on import? Is it changes some runtime params? How to turn it off?
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.13.1
Reproduction Steps
"use strict";
const initStart = performance.now();
const parse5_1 = require("parse5");
if (process.env.AWS_SDK === '1') {
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
const version = require('@aws-sdk/client-dynamodb/package.json').version;
console.log('DynamoDB', typeof client_dynamodb_1.DynamoDB, version);
}
const html = `<doctype html><html><head><title>Test</title></head><body><h1>Hello World</h1></body></html>`;
async function benchParse(count) {
for (let i = 0; i < count; i++) {
const doc = (0, parse5_1.parse)(html);
(0, parse5_1.serialize)(doc);
}
}
const name = 'bench-parse5';
const count = 1000000;
const benchFunc = benchParse;
const initDone = performance.now();
console.log('---', name, `init ${(initDone - initStart).toFixed(2)}ms`);
const startTime = performance.now();
console.profile(name);
benchFunc(count).then(() => {
console.profileEnd();
const grandTotal = performance.now() - startTime;
console.log(`Count: ${count} Time: ${grandTotal.toFixed(2)}ms`);
console.log('---');
});
{
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.592.0",
"parse5": "^7.1.2"
}
}
Observed Behavior
with dynamodb import
DynamoDB function 3.592.0
--- bench-parse5 init 66.59ms
Count: 1000000 Time: 4507.70ms
---
Expected Behavior
test output: around 800ms lower
--- bench-parse5 init 12.97ms
Count: 1000000 Time: 3730.11ms
---
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p1This is a high priority issueThis is a high priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlog