dimdenGD / ultimate-express

The Ultimate Express. Fastest http server with full Express compatibility, based on µWebSockets.
Apache License 2.0
518 stars 15 forks source link

NullObject issues #48

Closed Pho3niX90 closed 1 week ago

Pho3niX90 commented 1 week ago

The below is throwing off the tests, and ultimately skewing the true comparisons.

https://github.com/dimdenGD/ultimate-express/blob/3398194b8af64c2c9ade3a20bcc99c9b7804c6af/tests/index.js#L59

Whilst doing some testing in a real prod app, I noticed some behavior which was not the same as express.

Pulling request headers, for example, produced "NullObject <[Object: null prototype] {}> {}"

Is there a reason why the type is being used, instead of just an empty object?

dimdenGD commented 1 week ago

It's a way to create objects much faster, you can ignore the NullObject part in console.log as it's behavior is the same

Pho3niX90 commented 1 week ago

It's a way to create objects much faster, you can ignore the NullObject part in console.log as it's behavior is the same

The problem is, it was creating issues in middleware that rely on params and queries from headers., which then caused issues in rxjs

I am busy stepping through one of my prod apps to see where issues are, and try and resolve them as I find them

Pho3niX90 commented 1 week ago

Just did some quick tests:

creating 100K objects: {} = 18.615ms NullObject = 16.975ms

Albeit little difference, let me see if I can fix it another way.