Skip to content

Micro-optimizations for WeakMap #7670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

TysonAndre
Copy link
Contributor

@TysonAndre TysonAndre commented Nov 20, 2021

Skip WeakMap lookup check for assertion in non-debug builds

The expected performance impact is negligible,
the memory will be loaded from main memory into cache anyway
for the call to zend_hash_index_del.

Use the zend_hash_lookup helper to optimize adding a WeakMap entry
if the entry doesn't already exist.

EDIT: Should have targeted master according to CONTRIBUTING.md - tests of Zend pass in master as well

Branch
master Active development branch for PHP 8.2, which is open for backwards incompatible changes and major internal API changes.
PHP-8.1 Is used to release the PHP 8.1.x series. This is a current stable version and is open for bugfixes only.

Skip WeakMap lookup check for assertion in non-debug builds

The expected performance impact is negligible,
the memory will be loaded from main memory into cache anyway
for the call to zend_hash_index_del.

Use the `zend_hash_lookup` helper to optimize adding a WeakMap entry
if the entry doesn't already exist.
@TysonAndre TysonAndre changed the base branch from master to PHP-8.1 November 20, 2021 17:12
@TysonAndre TysonAndre requested a review from nikic November 20, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants