Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/48 #49

Merged
merged 11 commits into from
Nov 10, 2024
Merged

Bugfix/48 #49

merged 11 commits into from
Nov 10, 2024

Conversation

Pho3niX90
Copy link
Contributor

closes #48

Copy link

pkg-pr-new bot commented Nov 10, 2024

Open in Stackblitz

npm i https://pkg.pr.new/dimdenGD/ultimate-express@49

commit: b938cc4

package.json Outdated
@@ -59,7 +59,7 @@
"statuses": "^2.0.1",
"tseep": "^1.2.2",
"type-is": "^1.6.18",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.49.0",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.70.0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no 20.70.0 uWS.js, you're confusing it with C++ uWS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right. I was looking at the C++ version.

add: benchmark for object creation
add: benchmark workflow
@Pho3niX90
Copy link
Contributor Author

@dimdenGD I am finished with this now if you want to review.
I have added a benchmark workflow as well, super basic, and can post to the PR, I think you just need to enable it in your settings. Would give a nice indication if a PR is slowing the code down etc.

@Pho3niX90 Pho3niX90 requested a review from dimdenGD November 10, 2024 13:32
@dimdenGD
Copy link
Owner

Why do {...new NullObject()}? It's like creating a fast object and then creating a slow one and putting it inside. Would be faster to just have {} at this point

@Pho3niX90
Copy link
Contributor Author

Why do {...new NullObject()}? It's like creating a fast object and then creating a slow one and putting it inside. Would be faster to just have {} at this point

My initial thoughts. But ran some benchmarks, and seems it's faster like this. See if you get the same results from it?

@dimdenGD
Copy link
Owner

I don't see how it's possible for it to be faster that way. Microbenchmarks are often deceptive

@Pho3niX90
Copy link
Contributor Author

Pho3niX90 commented Nov 10, 2024

So these are the results (tests/sample/object_creation.js):

Min is not the lowest, but more consistent than the spread.

image

But I am fine with either. Should I change it back to {}

@dimdenGD
Copy link
Owner

You should probably test some reads+writes too. Also there's no point in using these spreads for internal stuff only used by library, only for public things like req.query and req.params

@dimdenGD dimdenGD merged commit 620f21f into dimdenGD:main Nov 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullObject issues
2 participants