Giter Site home page Giter Site logo

Comments (3)

Hilderin avatar Hilderin commented on August 19, 2024 3

I investigated a similar problem for the issue #89217

The problem seems the way the engine calls the C# methods. There are a lot of string comparisons to check which method to call in the generated C# partial class.

Example:

[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
{
    if (method == MethodName._Process && args.Count == 1) {
        _Process(global::Godot.NativeInterop.VariantUtils.ConvertTo<double>(args[0]));
        ret = default;
        return true;
    }
    return base.InvokeGodotClassMethod(method, args, out ret);
}

I did not create a PR because it needs quite a lot of modifications to execute calls from delegates or pointer functions but I made it work. I still need to do some testing and adjustments. I'll continue to work on it and keep you updated.

from godot.

warappa avatar warappa commented on August 19, 2024 2

Yes, even with just a completely empty method it has this performance issues.

public partial class SimpleCube : MeshInstance3D
{
    public override void _Process(double delta)
    {
    }
}

from godot.

AThousandShips avatar AThousandShips commented on August 19, 2024

Does it happen if you remove the base._Process? I don't think it's needed here as _Process is handled by the engine itself and doesn't rely on virtual methods (none of the code templates or official demos use the parent call)

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.