Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114805 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35656 invoked from network); 10 Jun 2021 04:50:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jun 2021 04:50:21 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2074C1804CC for ; Wed, 9 Jun 2021 22:05:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 9 Jun 2021 22:05:31 -0700 (PDT) Received: by mail-ej1-f45.google.com with SMTP id k25so36481395eja.9 for ; Wed, 09 Jun 2021 22:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HURma+X4fkfL1LXOG7/MauM9Fr4cfFjLJRY10PkSU3k=; b=r1a8RqRKCvOnLNDy+s8w3xcJHKnwe5SYq2djpfv4XxniATpBTIvSx7c0lQuKmdqkCr YeV1MJm52MkxpSuCqme8vp3Lc6p+tQ2BbXxYZvr+MRxD7EpQF8EXee3jBD0EXnxgE9kQ 95lcy6Eg41eVcgDG/MtAMtZyev6kyeSqXeLpu7eHNjAxwYC62+phufyz/NqtMHDU6F5+ t3IiQHKB8MuFxtC9mJkXBbcpPFZFYl/DcFq0WlKe9C0nEnRTUx9b/AO35IPPigJ+8hk3 e3a15BbftmwixRMm9vT34AUbbaznRR0WP+zyx8oh7rzm/SPerYpFiyNNZ88CXkgFl6hQ vebg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HURma+X4fkfL1LXOG7/MauM9Fr4cfFjLJRY10PkSU3k=; b=lsP1wgrXlHjT3AEa8rmKXHaqAb3LWD8kM5DaRU6MtMuHhpTpXK4vwID+ZeAQ7sngm+ v64s1YX+058vh+nLuMqQJuhuEWPJKjkjPGL/HSTXJAkS2zdsxSq1AO3iEoCBK0u6mf1U QjQNqbiV58qimEi64cpH/3Puko4j6QLKTg0Ec31RhALou4pMswsUV++LfPuUd+57invk 96fU/RMH9YDgLny+HfKE2Q01OvYhwYboVTTGlRjsaR8RIChi2vu4aICREAhU41IHq3uO drXpJziJHGYDoo6Vq3rdMZ6KDr2wZQ9+oBEmuRIRCzwoirjU8YUOxBuU3Nwc5pigiizb e3kw== X-Gm-Message-State: AOAM530HBnqmsufrUJKZWrN8FnJoD3z1GjXBwM0/QEyvV6OMDO5PZxYN qOe4fKtZZk5kktGkAQO3I3iU2XI8Qvt6V04hzgU= X-Google-Smtp-Source: ABdhPJza2vEvtjM10EIJC166NAqXVSUyos4vAIFPw6hKjPb5cpQ+swFL5ZDLoil1zBjuuPm+G1OIFqaOmX4jbd5CP5s= X-Received: by 2002:a17:907:2895:: with SMTP id em21mr2730072ejc.164.1623301529388; Wed, 09 Jun 2021 22:05:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 10 Jun 2021 08:05:12 +0300 Message-ID: To: tyson andre Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000005cb7205c462575c" Subject: Re: [PHP-DEV] Re: RFC: CachedIterable (rewindable, allows any key&repeating keys) From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --00000000000005cb7205c462575c Content-Type: text/plain; charset="UTF-8" On Wed, Jun 9, 2021 at 3:22 AM tyson andre wrote: > Hi internals, > > > I've created a new RFC https://wiki.php.net/rfc/cachediterable adding > CachedIterable, > > which eagerly evaluates any iterable and contains an immutable copy of > the keys and values of the iterable it was constructed from > > > A heads up - I will probably start voting on > https://wiki.php.net/rfc/cachediterable this weekend after > https://wiki.php.net/rfc/cachediterable_straw_poll is finished. > > Any other feedback on CachedIterable? > > Thanks, > Tyson > > Hi Tyson, Thanks for explaining 4 months ago about my concern. I think I understand the main real impact of an eager iterable cache vs a lazy iterable cache from a functional point of view: - exceptions are thrown during construction vs during the first iteration - predictable performance also on the first iteration. How did you gather the information that eager implementation is more valuable than lazy one? I'm mostly curious also how to assess this as technically to me it also looks the other way around. Maybe mention that in the RFC. I was even thinking that CachedIterable should be lazy and an EagerCachedIterable would be built upon that with more methods. Or have it in the same class with a constructor parameter. Also, being able to have a perfect userland implementation, not very complex, even considering the lower performance, is not that good for positive voting from what I remember from history... Regards, Alex --00000000000005cb7205c462575c--