Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51550 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47302 invoked from network); 2 Mar 2011 23:16:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Mar 2011 23:16:51 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:32956] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/F0-40003-2EFCE6D4 for ; Wed, 02 Mar 2011 18:16:51 -0500 Received: by fxm20 with SMTP id 20so526213fxm.29 for ; Wed, 02 Mar 2011 15:16:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=FJJV1Ptl8onZbyv1s8+ClB1KMZqk8SKWvtsZcbEQ8os=; b=s0MJVJJbRy2RMvQKTKvCG4KvWC3ct7dgOZrjsa6ynyuFYaf90abqru6OWh71mntec9 esmPDxQmNrIN8fAqaeIzKe6bbjrc+dqvx19hdzR2rb8N0HZ7nvXCKkpwKiDTCzgA3533 cRfAP5J6cPYAzDlNcGAKjctjAmTJa1IxQ9a6E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=kX+TNX61NzpE3dPGPswhfvNVar/PuuitneYyAlTqQWmM6Lxs2L/hkf/YzHn1sr8Ii4 8wj771J/Zw5hW8xDMC8810Fqz0cw/T+KjTUfcTH0jfTHCODs4Dd9h2cbBQQ9HWfJ9B5K G0PZzMwBsWQ4IdATipDOcy3llL4vDftSIbd/I= Received: by 10.223.101.129 with SMTP id c1mr615013fao.25.1299107807710; Wed, 02 Mar 2011 15:16:47 -0800 (PST) Received: from [192.168.1.26] (126.Red-81-38-140.dynamicIP.rima-tde.net [81.38.140.126]) by mx.google.com with ESMTPS id j12sm291444fax.33.2011.03.02.15.16.45 (version=SSLv3 cipher=OTHER); Wed, 02 Mar 2011 15:16:46 -0800 (PST) Message-ID: <4D6ED0CE.4040304@gmail.com> Date: Thu, 03 Mar 2011 00:20:46 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Stas Malyshev , PHP Developers Mailing List References: <4D6A3A9C.50308@seld.be> <4D6AEB6E.1060704@sugarcrm.com> In-Reply-To: <4D6AEB6E.1060704@sugarcrm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Volnitsky substring search algo From: keisial@gmail.com ("=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=") Stas Malyshev wrote: > Hi! > >> http://volnitsky.com/project/str_search/ > > I'm not sure it'd be easy to integrate this into PHP codebase as-is, > provided it relies on C++ standard libraries which PHP makes no use of > (and thus potentially introduces a world of dependencies and > complexities into the build process). I'm sure it can be re-done in > pure standard C, then it can be tested in PHP and if it's better - I > don't see why it can't be integrated. > Not really. It only uses std::search, which would be equivalent to the current zend_memnstr(). And std::numeric_limits can be replaced with a limits.h macro. I'd be more concerned about the "only for little-endian platforms and where access to misaligned W is allowed" remark. php is also available for big endian architectures, but that seems easy. Some architecture supported by php won't probably accept that, so it would also need some configure test to disable it.