Skip to content
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

Performance improvement #8

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

grammit
Copy link

@grammit grammit commented Jun 21, 2023

No description provided.

@grammit grammit requested a review from limenet June 21, 2023 12:40
@grammit grammit force-pushed the improvement/performance_improvement branch from 7610b1c to 5f855f2 Compare July 3, 2023 06:02
@grammit grammit marked this pull request as ready for review July 3, 2023 06:05
@limenet
Copy link
Member

limenet commented Aug 1, 2023

Thanks, @grammit, for your work, that looks like it took quite some effort!

Since this will most likely be a major release with lots of improvements and new features (e.g. the normalizer), can you please include a UPGRADE.md with steps needed to upgrade (if any) and update the README.md (or docs/) with some usage examples?

@limenet limenet force-pushed the improvement/performance_improvement branch from 5a6d415 to a98ccf0 Compare August 1, 2023 07:23
@@ -62,6 +62,10 @@ jobs:
- name: Install composer dependencies
uses: ramsey/composer-install@v2

- if: matrix.php-versions == '8.2'
name: Set phpstan configuration for PHP 8.2
run: cat phpstan-php8.2.neon > phpstan.neon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the contents of phpstan-php8.2.neon this could also be a mv instead of a cat (since you're using > and not >>). mv would probably make the intention a bit clearer.

Also, and this might be more important, Pimcore 10 does not allow PHP 8.2 so I don't think we even need to consider PHP 8.2 as long as we don't offer compatibility with Pimcore 11.

@@ -4,7 +4,7 @@

trait ClassBasenameTrait
{
protected function classBasename(string|object $class): string
protected static function classBasename(string|object $class): string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering the trait now only contains a single static method, we could also refactor it to be a class. What do you think?

Comment on lines 28 to 29
$loader->load('services.yml');
$loader->load('serializer.yaml');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One file is .yml, one .yaml. Should we change services to end in yaml, too?

valantic.dataquality.serializer.normalizer.datetime:
class: Symfony\Component\Serializer\Normalizer\DateTimeNormalizer
tags:
- { name: valantic.dataquality.serializer.normalizer, priority: -910 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment explaining the value of `-910?


Valantic\DataQualityBundle\EventListener\AdminObjectListListener:
# Pimcore Grid column configurations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably replaces Valantic\DataQualityBundle\Model\DataType\Score, correct? If so, can you please remove that file and also src/Resources/config/pimcore/config.yml?

width: 300,
height: 470,
width: 380,
height: 600,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
height: 600,
height: 620,

Currently the last row of text is slightly cut off

image

}

$scores = $this->validation->scores();
$score = $scores[$this->context['language']] ?? (array_sum($scores) / count($scores));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Division by zero if no scores are configured.

@@ -132,9 +126,6 @@ function(ItemInterface $item) use ($obj, $userConfig, $cacheService, $request, $
public function checkAction(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using the Pimcore Demo setup, there's a custom class in use for Car (App\Model\Product\Car). Unfortunately, this does not work since the class Pimcore\Model\DataObject\Car is being configured in the settings. Do you have an idea how we could solve that?

@@ -64,7 +91,7 @@ public function score(): float
return 0;
}

$score = $this->calculateScore();
$score = array_sum($this->scores()) / count($this->scores());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Division by zero

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.

None yet

3 participants