Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79281 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59458 invoked from network); 28 Nov 2014 16:39:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2014 16:39:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@bof.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: php@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:50132] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/7F-59154-555A8745 for ; Fri, 28 Nov 2014 11:39:52 -0500 Received: (qmail 9299 invoked by uid 1009); 28 Nov 2014 17:39:45 +0100 Received: from 209.85.216.41 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/19690. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.216.41):. Processed in 0.26692 secs); 28 Nov 2014 16:39:45 -0000 X-Antivirus-MYDOMAIN-Mail-From: php@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.216.41):. Processed in 0.26692 secs Process 9293) Received: from mail-qa0-f41.google.com (gmail@bof.de@209.85.216.41) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 28 Nov 2014 17:39:45 +0100 Received: by mail-qa0-f41.google.com with SMTP id f12so4756859qad.28 for ; Fri, 28 Nov 2014 08:39:42 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.140.35.105 with SMTP id m96mr64656267qgm.8.1417192782858; Fri, 28 Nov 2014 08:39:42 -0800 (PST) Received: by 10.140.37.41 with HTTP; Fri, 28 Nov 2014 08:39:42 -0800 (PST) Received: by 10.140.37.41 with HTTP; Fri, 28 Nov 2014 08:39:42 -0800 (PST) In-Reply-To: References: <9846323.EvUROnfLfe@rofl> Date: Fri, 28 Nov 2014 17:39:42 +0100 Message-ID: To: Ferenc Kovacs Cc: Sebastian Krebs , internals , Bostjan Skufca Content-Type: multipart/alternative; boundary=001a11c03cec669b810508ede869 Subject: Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle() From: php@bof.de (Patrick Schaaf) --001a11c03cec669b810508ede869 Content-Type: text/plain; charset=UTF-8 Am 28.11.2014 15:46 schrieb "Ferenc Kovacs" : > > from a quick test using spl_object_hash seems to be the slower with big number of elements in haystack. Your test only does the is-it-known test once. For an already-visited-set use case the test will run once for each visited element, and will usually fail, too, thus running the whole already built haystack at each point from front to end with in_array - overall N*(N/2) test + N*simple-array-append for the in_array approach, vs. N test + N*spl_object_hash-append. best regards Patrick --001a11c03cec669b810508ede869--