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

Optimizations for longrunning applications #569

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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