aleksip / plugin-data-transform

Data Transform Plugin for Pattern Lab PHP
GNU General Public License v2.0
34 stars 10 forks source link

Excessive performance downfall after updating to 1.0.0 #8

Closed derhasi closed 6 years ago

derhasi commented 8 years ago

I just wanted to update from 0.10.2 to 1.0.0, but sadly with the update the generation is taking massively longer and the memory need has increased massively too.

Do you have a clue where this huge step comes from?

Console output

$ php pattern-lab/core/console --generate
Could not open input file: pattern-lab/core/console
$ php core/console --generate
configuring pattern lab...
your site has been generated...
site generation took 6.36483597755 seconds and used 35.25MB of memory...
$ composer require "aleksip/plugin-data-transform":"^1.0.0"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing aleksip/plugin-data-transform (v0.10.2)
  - Installing aleksip/plugin-data-transform (v1.0.1)
    Loading from cache

> PatternLab\Installer::postPackageUpdate
Writing lock file
Generating autoload files
> PatternLab\Installer::postUpdateCmd
$ php core/console --generate
configuring pattern lab...

Notice: Undefined index: icon in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: icon in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: icon in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: icon in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: icon in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: icon in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64

Notice: Undefined index: visual in [...]/pattern-lab/vendor/aleksip/plugin-data-transform/src/aleksip/DataTransformPlugin/DataTransformer.php on line 64
your site has been generated...
site generation took 31.1519939899 seconds and used 406MB of memory...

Undefined Index

The undefined index notice comes from pattern specific json values being declared as "icon": null. Maybe that is something to look into in a separate issue.

sghoweri commented 8 years ago

Seeing the exact same issue on my end. Since upgrading to the latest version I'm seeing Pattern Lab's generation times and amount of memory consumed skyrocket =/

sghoweri commented 8 years ago

@aleksip @EvanLovely Any ideas what might be causing this problem?

Definitely feeling the hurt on my end with 20+ second PL compile times so happy to help however I can on my end!

aleksip commented 8 years ago

Thanks for reporting about this problem. I'll try to fix it first thing when I have some free time, hopefully very soon. Meanwhile I suggest reverting to 0.10.2 unless you need to use global data.

Not sure what is causing the problem. PRs are welcome! :)

aleksip commented 8 years ago

@derhasi @sghoweri Could you please try the dev branch and let me know how it works for you? Should be as easy as running

composer require aleksip/plugin-data-transform dev-dev

in your Pattern Lab directory.

sghoweri commented 8 years ago

Thanks @aleksip! Checking it out now - will let you know once I give it a go.

sghoweri commented 8 years ago

@aleksip Hmmm - I'm still seeing similar (worse??) memory / compilation times on my end. Is this expected?

image

aleksip commented 8 years ago

@sghoweri Thanks for testing, and no, not expected. I will have to keep investigating for the cause.

How many patterns do you have in your Pattern Lab project? Do your data/template files contain a lot of includes/embeds? Is there any way you could provide your project to me for debugging/testing?

Have you tried/could you please try generating Shila theme with both 0.10.2 and dev-dev to see if you get similar results?

aleksip commented 6 years ago

@derhasi @sghoweri Is this still a problem for you or have you stopped using Data Transform Plugin?

sghoweri commented 6 years ago

@aleksip I know @EvanLovely and I haven't been using the Data Transform (or Data Inheritance plugins for that matter) in the Bolt Design System given the couple techniques we've been running with (ex. using the D8-friendly create_attribute Twig function via a Twig extension I added to PL) so I'm not sure if the memory issues I know I had been seeing are still an issue... 🤔

aleksip commented 6 years ago

ex. using the D8-friendly create_attribute Twig function via a Twig extension I added to PL

Interesting! Is this in Bolt only or have I just missed it being added to the official version Pattern Lab?

sghoweri commented 6 years ago

It's a Bolt-only thing (via this, this, and this) however that's the sort of thing I'd really love to get folded into the PL Twig Extensions project!

Oh and as of a couple days ago, we now have a drop-in replacement of the D8 | without Twig filter that actually works. Just need to get that PR'd in once I"m back from vacation :)

aleksip commented 6 years ago

Closing this as the code has changed since the original reports and I am unable to replicate. Will reopen if this continues to be a problem for someone.