Created by: wangxicoding
PR types
Performance optimization
PR changes
Others
Describe
When the item is ndarry, _check_input_array will copy it as a new array, this copy is unnecessary. Now use asarray
to optimize this scene.
As shown in the figure, when the amount of data is 100 * 300 * 768 * 4 = 87.89MB, it takes 77.7ms to copy. While asarray
uses zerocopy in this scenario, which takes only 326ns.