Skip to content

Conversation

@gam6itko
Copy link

@gam6itko gam6itko commented May 14, 2024

I'm working on increasing fractal performance in lognrunning application.

Not to setCurrentScope

First step is to make Transformer immutable. We must not set current scope to Transformer. This will give us opportunity to store transformers in service container. Scope should be passed to each transform or includeSomething method as argument.

public function transform(array $data, ScopeInterface $scope): array
{
    // magic here      
}

public function includeSomethingarray $data, ParamBag $p, ScopeInterface $scope): array
{
    // magic here      
}

TransformerAbstract should be removed.

User must construct his own Transformer class.

Now TransformerAbstract looks like

abstract class TransformerAbstract implements HasIncludesInterface, ScopeAwareInterface
{
    use HasIncludesTrait;
    use IncludeMethodBuildTrait;
    use ResourceCreateTrait;
    use ScopeAwareTrait;
}

For example User can make he`s own lightweight Transformer without includes. It will be a little faster because we do not spend time on figure out what to include.

abstract class MyAbstracttransformer
{
    use IncludeMethodBuildTrait;
    use ResourceCreateTrait;
}

Any mention of TransformerAbstract has been removed from Scope.

Also

  • Include method names caching.
  • ManagerInterface
  • ScopeInterface
  • A couple of Transformer interfaces.
  • Ability to avoid memory leaks.

gam6itko added 2 commits May 13, 2024 21:46
Avoid memory leaks. ServiceContainer ready. Transformer interfaces.
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.

1 participant