Re: [PHP-DEV] Potential binary search optimization or feature

2015-04-14 Thread Danylo Medinsky
Thanks for the feedback and apologies for the late response. Since my posting and your responses, I began implementing the binary search into array.c. After a couple days of coding and research, I managed to produce this code. HashTable *arr_hash; arr_hash = Z_ARRVAL_P(array); int low

Re: [PHP-DEV] Potential binary search optimization or feature

2015-04-01 Thread Stanislav Malyshev
Hi! > to utilize a binary search algorithm. Since the requirement for a binary > search is that the array being searched is sorted, I thought is would be a > good idea to have a Boolean parameter in the binary search function to > specify if the input array should be sorted or not. something among

Re: [PHP-DEV] Potential binary search optimization or feature

2015-03-30 Thread Nikita Popov
On Mon, Mar 30, 2015 at 8:24 AM, Danylo Medinsky wrote: > Recently, as part of school course on optimization, I have identified a > potential optimization or feature for PHP. After looking through the > array.c file(located in etc/standard in the PHP source code), I noticed > that both the in_arr