gr3p1p3 / transparent-proxy

41 stars 17 forks source link

Performance Issue between v1.12.0 & > v1.12.1 #35

Closed gr3p1p3 closed 1 year ago

gr3p1p3 commented 1 year ago

I'm having a Performance issue in my application, since I refactored the parsing of Request & Response in a OOP-Paradigm. As much as requests etc. work as usual and as expected, the traffic seems to have halved.

Does anyone have an idea why? Could it really be the use of Classes? I read multiple article about it, but it seems strange to me that the impact is really so exaggerated, E.g. Please stop using classes in js.

I monitored this behaviours on my application, left the new @1.12.2 was used, while in the right side the @1.12.0:

differences

Is anyone experiencing the same problem?

gr3p1p3 commented 1 year ago

It look likes usage of Classes make requests slower. The consequences are catastrophic if it is used to generate many requests. I'm glad to say that I needed to revert the code.

A perfect example of this can be found here Function-vs-Class Benchmark

v1.12.4 includes the old logic of Session-Class + Bugfixes of v1.12.3.