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

small performance improvement when streaming. #675

Merged
merged 2 commits into from Jan 29, 2015

Conversation

connortechnology
Copy link
Member

This may not be the way to go.

From what I read, we really should be using std::string instead of doing it the C way.

In any event, at least not calling strlen(swap_path) many times is good.
PATH_MAX is 4096 on Linux, and is actually filesystem dependent, so it is silly to even worry about it.

So this saves us 4k-whatever length the swap_path actually is on the stack.

comments?

@knight-of-ni
Copy link
Member

What you've got looks fine to me, but admittedly this is an area of zoneminder where I have not taken the time to get a deep understanding of what is going on.

@connortechnology
Copy link
Member Author

what I have here has a memleak of course. I have the fix for it, just havn't committed it yet.

The debate is guess is the use of malloc to allocate such a small amount of mem vs using and dealing with 4k on the stack

connortechnology added a commit that referenced this pull request Jan 29, 2015
small performance improvement when streaming.
@connortechnology connortechnology merged commit 7e685bb into master Jan 29, 2015
@connortechnology connortechnology deleted the small_performance_improvement branch May 14, 2015 14:05
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.

None yet

2 participants