twitter / vireo

Vireo is a lightweight and versatile video processing library written in C++11
MIT License
927 stars 111 forks source link

Optimized 5 different buffers. #26

Open shahzadlone opened 5 years ago

shahzadlone commented 5 years ago

Many vectors weren't being reserved where we already know the size.

This makes the vector re-allocate(expensive) more times than necessary.

I reserved the 5 vectors where we already knew how many elements will get pushed in.

I also reduced the scope of audio_samples,video_samples,edit_boxes because they were declared way earlier than they are actually used. (prefer to delay declaration, as much as possible.)

Also made edit_box a constant and a reference to save a copy cost and const because it isn't changed.

CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.