I suggest you ...

Improvement of run-time performance

Reduce the run-time overhead of PostSharp, especially the load on GC. Specifically, design new kinds of advices that receive the context on the stack and on the heap.

55 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    gfraiteurAdmingfraiteur (Admin, PostSharp Technologies) shared this idea  ·   ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Victor PeltVictor Pelt commented  · 

        Note, the OnSuccess<IDisposable> is just to clarify the idea. More likely the syntax would be

        OnSucces<Action<IDisposable>>. By using Action & Func (or a variation thereof) this pattern would be more generic.

      • Victor PeltVictor Pelt commented  · 

        I would be very nice if some amount of type-wareness could be applied to aspects,.

        For example

        public void SampleAspect : OnMethodBoundaryAspect {

        public override void OnSuccess<TReturnType>(MethodExecutionArgs<TReturnType> args) {
        Debug.Assert(args.ReturnValue.GetType() == typeof(TReturnType))
        if (args.ReturnValue == null)
        args.ReturnValue = default(TReturnType);
        }

        }

        Now there are a few corollaries that would make this idea even better

        public void SampleAspect2: OnMethodBoundaryAspect

        public void OnSuccess<IDisposable>(MethodExecutionArgs<IDisposable> args) {
        args.ReturnValue.dispose();
        }

        now if i do this

        [SampleAspect2]
        public void Foo() {...}

        this shouldn't complile because Foo doesn't have return type IDisposable

        Maybe this technique couldn't be applied everywhere but even if it were possible in specific cases it would reduct the boilerplate of creating an aspect, and reducting boilerplate code is (to mee) what postsharp is all about

      • Olaf KoberOlaf Kober commented  · 

        At the moment we use PostSharp only on types not called very frequently, because this generates a lot of those context objects. This is especially important for us since we are running on a resource constraint embedded device. Contracts are working fine, but all threading-related aspects have to be chosen wisely.

      Feedback and Knowledge Base