8000 Fixed bloat, fixed some minor issues and added a bunch of comments by ColleagueRiley · Pull Request #1 · ferhatgec/xss · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixed 8000 bloat, fixed some minor issues and added a bunch of comments #1

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ColleagueRiley
Copy link

Added a bunch of comments commenting on changes that should be bad [I don't really wanna make many fundamental changes].

But I also removed a lot of the bloat included (including a lot of the c++ standard library), some of the ugly code (from the std library, almost none of yours).

And did some other minor fixes.

I also completely removed the xss_main class and header as they're not required really.
Some suggestions for changing it are included.

@ferhatgec
Copy link
Owner

thank you for this pr! what about making your repository named as xss-c or anything else huh because everything else is written in c except std::string that's makes no sense to writing up in c++ imo. thanks for the reviewing my trash code btw!

@ColleagueRiley
Copy link
Author

I removed many of the C++ standard libraries because C++ standard libraries are pretty bloated, especially compared to their C counterparts. They were a lot simpler to implement.

I removed some of the C++ features you used because most of them weren't severing much of a purpose. For example the code is essentially the same thing with the class as it was without it. So there wasn't much reason to have a class.

Maybe you could replace the class with a namespace instead? Abstraction is almost never free. Most abstraction (such as the use of objects) come with some performance drop especially. Making it important to use the best tool for the job rather than the flashiest.

@ColleagueRiley
86F5
Copy link
Author
ColleagueRiley commented Jul 11, 2023

Also, at the first least I'd suggest checking out some of the other changes I made

for example changing

unsigned char* arr = new unsigned char[width * height * 3];

which allocates memory from RAM when you don't really need to. Plus allocating memory from RAM takes more time than just using stack memory.

into

unsigned char arr[width * height * 3];
(and removing delete[] arr)

which just uses memory from the stack

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.

2 participants
0