You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an email with @GordonLesti , the topic of efficient internal representation of matrices was discussed. There were concerns about the current approach of using nested arrays. The other alternative is to store one single array, and store another variable for the shape of the matrix. Currently I am researching which would be optimal.
I know you had mentioned that in some cases the nested array performed better and in other cases the single array representation performed better. Do you happen to remember or have it documented which operations were most efficient with which representation? That would be helpful information. I can generate new benchmarks if needed, but trying to save that step.
As I gain more insight into this, I will update this thread with relevant information and proposals. Thanks.
The text was updated successfully, but these errors were encountered:
Hi, I don't think array it the best solution for this project. I think the best solution is we have to write a new extension and store our matrix using fixed-size C++ array, and all of elements of this array should be the same type.
As I remember that the numpy loop with nditer is faster 10 times that native python loop, because it run on C++ instead of python. PHP using HashTable for storing array so it not really efficiency
Hello @rickynguyen
thank you very much for your feedback. Yes, real arrays would be fantastic, but in my eyes it is no option to transform a plain PHP library into a PHP extension. I started developing on version 2 of NumPHP with PHP 7 as requirement and have not changed the internal representation yet. My hope is that packed arrays will give some performance improvement.
Maybe after a stable release it can make sense to create a PHP array extension that will be used as suggested dependency.
Just do some researching about how PHP7 optimized their array. I see that they store zval inside Hashtable instead of pointer like PHP5 before. Right now I think you has chosen the right way..! 🎈
In an email with @GordonLesti , the topic of efficient internal representation of matrices was discussed. There were concerns about the current approach of using nested arrays. The other alternative is to store one single array, and store another variable for the shape of the matrix. Currently I am researching which would be optimal.
I know you had mentioned that in some cases the nested array performed better and in other cases the single array representation performed better. Do you happen to remember or have it documented which operations were most efficient with which representation? That would be helpful information. I can generate new benchmarks if needed, but trying to save that step.
As I gain more insight into this, I will update this thread with relevant information and proposals. Thanks.
The text was updated successfully, but these errors were encountered: