News for hackers. Stuff that matters.
Re:PHP 7's new hashtable implementation by nly on Tuesday December 23, 2014 @07:01AM (#8787797)
PHP isn't written in C++. It's written in some pretty macro dense C. Even if it were, <map> isn't a hash table.
Re:PHP 7's new hashtable implementation by acmd on Tuesday December 23, 2014 @07:36AM (#8787879)
But std::unordered_map is. I wonder what would be the actual C++ memory consumption using that.
Re:PHP 7's new hashtable implementation by sharpneli on Tuesday December 23, 2014 @11:54AM (#8788884)
C++ unordered map does not maintain the order of the elements, which PHP does. So it is not a fair comparison.
Re:PHP 7's new hashtable implementation by nly on Tuesday December 23, 2014 @01:15PM (#8789309)
Something approximately equivalent would be Boosts multi_index with a couple of indexes.

    using php_array_t = multi_index_container<
        int64_t,
        indexed_by<
            random_access<>,
            hashed_unique<identity<int64_t>>
        >
    >;
There are so many design considerations at play though that such a comparison would be pointless.