Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105703 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68432 invoked from network); 14 May 2019 17:37:03 -0000 Received: from unknown (HELO mail-lf1-f42.google.com) (209.85.167.42) by pb1.pair.com with SMTP; 14 May 2019 17:37:03 -0000 Received: by mail-lf1-f42.google.com with SMTP id l26so6445565lfh.13 for ; Tue, 14 May 2019 07:42:43 -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=UYsjhutB+MJB9yiMAb9gQwKMglH+xAWuZrKt2xfE0vw=; b=QC1KIjEKquqMHp46acQBEZZNwFKbOSxhSHU8ns0qW3Yp4AlOzz0/rdhqheq51WE0vY mi0mJrC8FaFSJTgfSoD/5MV8ZuwVoMf5eSpBsJZP8ZlXTHLS+4lSdcNr04F0OHO2gz4I 1LQ18a+qNpp6V+/PGLpBWh9MN4vsi5xJejJULUA+zZd8w7qekwXbensKl+UaRI8Q2Ud/ 3fAN6M7GOHZyD0sdl3Our0rLCogQKNAEDPKOLjftTI2MSos2WiNCfOiqzyFkK3S7G4ia LZrnXHSJyXaTJOZmI67L6c/G5NEkKvZe4nclOkHVM+wCAJuCqgEAg5GY8lBrN6hJjxB9 IAyA== 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=UYsjhutB+MJB9yiMAb9gQwKMglH+xAWuZrKt2xfE0vw=; b=gr8ufj946krW90E+daD7YZPEQSH85vlQptO119bxmaF6IIgXeAlxt9bUajIjSwMePc VVZTfi+i/+ODHuBedkM03T03zYTh7tZy7Qc0cU3VbqTzQ+NDZybjNuBPUkgm07YHpLpU qDCnkwyR4l8V9BRb1dNvLLn1vwbCX2ZEL3ebRB/bRSjCWNFV5H+znEASpAwnf1UgePGT 6HP9I6FdyLjgLhZjA4LuEXKJ53xRKHNOar0Q91AjRF3aYQgsxRgjFd18ymlrLTsL7GJK GZmKhjjtfo/xWMhvCi9+eQwpL9dzJUHz8vbZkyqlGeAxXYIrRJ5yGFzC+4GO/6lSxlj1 HLYw== X-Gm-Message-State: APjAAAUmiigk4AP8EC7mBxOu8Z8M5a5TRE3zC5FvrA54/rUf8iUq2PiZ JOWv/63nkTba6Eht+oi5hGOKwfOekE9oqUFEIVs= X-Google-Smtp-Source: APXvYqxTeOFjwhB+WS0kJ3i+jpdtXMf66iAQTsiy6JDSD/YW87KUZC9bfyjOJyJwbqpTNfZ0RcVu5Maq5koXCxta5Go= X-Received: by 2002:ac2:4213:: with SMTP id y19mr8069538lfh.66.1557844962246; Tue, 14 May 2019 07:42:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 14 May 2019 16:42:26 +0200 Message-ID: To: Benjamin Morel Cc: Steven Wade , PHP internals Content-Type: multipart/alternative; boundary="00000000000097041b0588da0bcd" Subject: Re: [PHP-DEV] Add get_mangled_object_properties() From: nikita.ppv@gmail.com (Nikita Popov) --00000000000097041b0588da0bcd Content-Type: text/plain; charset="UTF-8" On Tue, May 14, 2019 at 4:29 PM Benjamin Morel wrote: > I like the explicitness of the proposal, but only if performance is as > good as (array) cast. One of the reasons we use casting to array in > libraries is not only to access all properties at once, but also because > it's fast as it's implemented as an opcode and not a function call. Would > this function come with its own opcode, like strlen() / gettype() / etc.? > > Ben > I don't think an opcode is worthwhile in this case, because the primary cost is in constructing the property array. On this micro-benchmark https://gist.github.com/nikic/f592686c75d8d34d82ddc5900b598199 the results are: array cast: float(0.39156699180603) get_mangled_object_vars(): float(0.41520500183105) So no relevant difference in performance. Nikita --00000000000097041b0588da0bcd--