Skip to content

Global helpers perf considerations #9

@lonix1

Description

@lonix1

Hi again @adams85.... I'd like to ask your opinion on a perf-related issue?

As I mentioned in #8, your solution for "global helpers", also implemented in this repo, is outstanding. As I noted in a comment there, I added a new feature request to the aspnetcore repo - maybe they'll change their mind and give us App_Code or something similar.

Until then we use your solution heavily. It works magnificently.

The problem is it's really complicated, so we treat it as a black box, which "just works". There are many snippets which we need all over the place, so instead of injecting the helpers class into various views, we decided to just keep it simple and inject it into _ViewImports.cshtml so it's available everywhere.

But that means exactly that - it's injected everwhere, in every view, in (almost) every partial.

Given that you know how it works, do you think that may be too "heavy"? I'm not asking for hard perf benchmarks, just a common-sensical opinion.

How do you typically do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions