PHPackages                             monogo/optimize-object-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. monogo/optimize-object-manager

ActiveMagento2-module

monogo/optimize-object-manager
==============================

Magento 2 module to optimize Compiled ObjectManager

1.0.3(5y ago)436MIT

Since Jun 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/MonogoPolska/monogo-m2-optimize-object-manager)[ Packagist](https://packagist.org/packages/monogo/optimize-object-manager)[ RSS](/packages/monogo-optimize-object-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

#### Magento 2 module to optimize Compiled ObjectManager.

[](#magento-2-module-to-optimize-compiled-objectmanager)

This module will work only with Magento 2.3.4 and higher

**Important**
=============

[](#important)

This is experimental functionality, You are using it at your own risk !

**Install**
===========

[](#install)

### Composer

[](#composer)

In perfect world, command `composer require monogo/optimize-object-manager`should do the job.

But in few cases, composer do not recognize patch files.

If you don't see line

```
  - Applying patches for magento/framework"

```

run

```
composer require cweagans/composer-patches

```

Add in your composer.json

```
"extra": {
           "composer-exit-on-patch-failure": true,
           "patches": {
               "magento/framework": {
                   "Optimize Magento ObjectManager ConfigLoader: ": "https://raw.githubusercontent.com/MonogoPolska/monogo-m2-optimize-object-manager/master/patches/composer/optimize-config-loader.diff"
               }
           }
       }

```

Run

```
composer install

```

You should see line

```
  - Applying patches for magento/framework"

```

if not, go to vendor/magneto and remove framework directory, then re-run

```
composer install

```

### Magento Setup

[](#magento-setup)

- Run Magento commands

`php bin/magento setup:upgrade`

`php bin/magento setup:di:compile`

`php bin/magento setup:static-content:deploy`

- Make sure your that Magento 2 instance is running in Production mode and after installation **generated/metadata** directory is not empty

**Configuration Options**
=========================

[](#configuration-options)

Edit app/etc/env.php

add lines:

```
    'monogo_autoload_optimization' => [
        'enabled' => 1,
        'allowed_area' => [
            'frontend',
        ],
    ],

```

- enabled - 0 or 1
- allowed\_area - Magento 2 area (frontend,adminhtml,crontab,webapi\_rest,webapi\_soap,...) .

**Check**
=========

[](#check)

After installation and configuration, you should see new files in **generated/metadata** , for example:

- \_\_frontend\_global\_diff.php
- \_\_adminhtml\_global\_diff.php

**How it works**
================

[](#how-it-works)

When you are using M2 in Production mode and **generated/metadata** directory is not empty, magento is using Compiled mode in Object Manager.

Generated files contains all classes and are heavy.

In my case it was &gt;8 MB per one area file.

Magento is loading global.php file and after that your area file (for example frontend.php).

This module is calculating diff between global.php and given area, and it is saving new file \_\_\[area\_code\]\_global\_diff.php

If diff file exists, it is coping loaded global config to given area, and it is patching config with the diff.

The original area file (for example frontend.php) is skipped.

In my case (API call) it improved simple request by 14% of time and 33% of memory used.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

2166d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87059637e00638d5d5d08d8e94ef97b3168cd0b4bfde4e512ed77cef38106ae5?d=identicon)[Monogo](/maintainers/Monogo)

---

Top Contributors

[![pawel-detka](https://avatars.githubusercontent.com/u/17678684?v=4)](https://github.com/pawel-detka "pawel-detka (5 commits)")

---

Tags

optimizationmagento 2ObjectManager

### Embed Badge

![Health badge](/badges/monogo-optimize-object-manager/health.svg)

```
[![Health](https://phpackages.com/badges/monogo-optimize-object-manager/health.svg)](https://phpackages.com/packages/monogo-optimize-object-manager)
```

###  Alternatives

[magepal/magento2-gmailsmtpapp

Magento 2 SMTP Extension - Configure Magento 2 to send all transactional email using Gmail, G Suite, Amazon SES, Office360, Mailgun, SendGrid, Mandrill or any other SMTP servers

3321.8M2](/packages/magepal-magento2-gmailsmtpapp)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[magepal/magento2-googletagmanager

Google Tag Manager (GTM) for Magento 2 with Advance Data Layer

2671.5M4](/packages/magepal-magento2-googletagmanager)[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2091.2M7](/packages/yireo-magento2-webp2)[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[tig/postnl-magento2

TIG Magento 2 PostNL extension

58544.2k4](/packages/tig-postnl-magento2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
