Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116077 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 23656 invoked from network); 17 Sep 2021 18:57:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Sep 2021 18:57:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 73F7A1804B3 for ; Fri, 17 Sep 2021 12:37:15 -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_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 ; Fri, 17 Sep 2021 12:37:12 -0700 (PDT) Received: by mail-ed1-f50.google.com with SMTP id g21so33989235edw.4 for ; Fri, 17 Sep 2021 12:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+B8prV7A96rymzwXq37tJnfOoZvmsQ6dyQ8twlBSMFo=; b=AXrM6DF1VKFbR8nyMTxVAHYY9NoinnEaE3BVIjBZC0YhdX5dPHn2BNEHYIesBhRQth n/ySRYZJL9ebNfjqZmspQyIreHErMw/BeHDLgLWnAgt458VhUIoT5udaZ5ZVd/y0G7wL Xn77FB8GCzpzV4YEyzQyNV4qvXFzmWk0rBAbQE3Wx3nlS1ajoylRsrLcKO6HHbN84VXs AUbp2QrMcFF+JK4bVI0V4c/n9HA80n3Y3FtJP9JDOKuXk2QUoxjbLoBF0wPMmuVSuL03 8kJN13u4V5nYGwL/Y8GW0ajW77QsuSIZFuG5XymwdiljcpAUwq0SCRJUtzJD/ZbSsUf7 m6Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+B8prV7A96rymzwXq37tJnfOoZvmsQ6dyQ8twlBSMFo=; b=NEV2A+6B1whu9V0hCN8ausN7cZFEV2N1LmfMqAVFXYY2iIogallRUKIsvj5aL+3t1q 2hDc+POgQKEgKBMDg+1ccEopQ8R8IttKAoU54vBoUT5JtgC2X0LRhp1D0uE1mJ8vgBr/ 1qDIV5c9ibf4Q3PNutkkkBjOlfbWREyki2QoSUtH0zHyvzZQtu/fQUKpYc2Y2173CZA9 AYgIlvcoQt9aHn7qz0ZxfxhRnIcRpT7eHrS25LhrPfrLNZ41PSkqcG7KO84XLvxihTgH 1JevsG5SeSvdRum0pN6srbHAP93qvQlQD9o3TnGZAfnv8zOduDXq+nERBTIfU5Fd6VMH BAQQ== X-Gm-Message-State: AOAM533LGPpwXbq88W9G7uVmROrE0ftimS/oLP4MlIvfMmZA/jskZvQZ 1JunxZrX3nx+p6aXr1MGDOL2Vg1628asQ3kbca2pKOoDfpE= X-Google-Smtp-Source: ABdhPJzNqpOF4MGEOT9SFcJiCbVNxtlPo/SHUp68P/IbkPIfyOCiz9StGh0ZdBNimGLXGi6Ip3hCydhoRillidg+RpQ= X-Received: by 2002:a17:906:31cf:: with SMTP id f15mr13861424ejf.272.1631907430858; Fri, 17 Sep 2021 12:37:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 17 Sep 2021 22:36:59 +0300 Message-ID: To: tyson andre Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000b903ae05cc360e60" Subject: Re: [PHP-DEV] RFC: Add `final class Vector` to PHP From: maxsem.wiki@gmail.com (Max Semenik) --000000000000b903ae05cc360e60 Content-Type: text/plain; charset="UTF-8" On Fri, Sep 17, 2021 at 5:10 AM tyson andre wrote: > Hi internals, > > I've created a new RFC https://wiki.php.net/rfc/vector proposing to add > `final class Vector` to PHP. Thank you so much, Tyson - I love your proposal. Since Ds was mentioned, I've added it to your benchmark (code and complete results at https://gist.github.com/MaxSem/d0ea0755d6deabaf88c9ef26039b2f27): Appending to array: n= 1048576 iterations= 20 memory=33558608 bytes, create+destroy time=0.369 read time = 0.210 result=10995105792000 Appending to Vector: n= 1048576 iterations= 20 memory=16777304 bytes, create+destroy time=0.270 read time = 0.270 result=10995105792000 Appending to SplStack: n= 1048576 iterations= 20 memory=33554584 bytes, create+destroy time=0.893 read time = 0.397 result=10995105792000 Appending to SplFixedArray: n= 1048576 iterations= 20 memory=16777304 bytes, create+destroy time=2.475 read time = 0.340 result=10995105792000 Appending to Ds\Vector: n= 1048576 iterations= 20 memory=24129632 bytes, create+destroy time=0.389 read time = 0.305 result=10995105792000 Another comparison with Ds, I wonder if an interface akin to Ds\Sequence[1] could be added, to have something in common with other future containers. ----- [1] http://docs.php.net/manual/en/class.ds-sequence.php -- Best regards, Max Semenik --000000000000b903ae05cc360e60--