Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Throwing exceptions wastes resources #634

Open
ByronAP opened this issue Sep 22, 2019 · 2 comments
Open

Throwing exceptions wastes resources #634

ByronAP opened this issue Sep 22, 2019 · 2 comments

Comments

@ByronAP
Copy link
Contributor

ByronAP commented Sep 22, 2019

It looks like there are a few places where exceptions are intentionally being throw. This seems to have a very adverse effect on performance, especially in RequestHandler and ResponseHandler and how they bubble up.

@honfika
Copy link
Collaborator

honfika commented Nov 16, 2019

Agree, I also hate that much exceptions. Something shoud be done :)

@justcoding121
Copy link
Owner

justcoding121 commented Nov 17, 2020

I noted up to 54 exception explicitly thrown. I am to blame for writing the most new exceptions :-)
https://github.com/justcoding121/Titanium-Web-Proxy/search?q=throw

Some of the exceptions are thrown so that the client/server connection can be disposed on the parent call. A way to reduce this would be to log the error, then dispose the connections immediately if they are in scope. If client/server connections are in parent scope, we need to return an error status from child method to parent method, so that parent can call dispose.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants