MechWarrior99
High performances way to access members?
Hello, I'm developing a API for visiting members of a object and reading their values, for using in serialization, data validation, etc.
I am trying to make it high performant (as reasonably possible), so I want to avoid boxing from reflection. So I've been using generics with MakeGenericMethod/Type with PropertyInfo and delegates to avoid it mostly. The issue is that it isn't well supported with Native AOT.
So an alterative I thought of was to mark every class/record/struct with an attribute, and use source generation to make a 'handler' for it. But that feels like it would really bloat the class count along with compile times.
Any recommendations, insights or alternatives?
14 replies
How to safely access parameters from Task (Porting from Unity IJob)
I am making a program for generating a 3D mesh from parameters.
The generation is done in some Tasks run with
Task.Run
. I'm struggling to grasp how to properly and safely access the parameters when generating.
I am porting the system over from Unity's IJob system, which I think is sort of 'boxing' my thinking in making it hard to get my head around what I need to do.
Do I make a class/struct that has all the parameters in it that I populate beforehand and use those values during generation? Sort of like Unity's Job system.
Thanks 🙂36 replies
❔ Cancel task on nested exception
I have a series of nested async methods, when a exception is thrown I want to cancel the task.
The main issue is that I need to do a
try cache
in a for
loop in a nested method, so that we can get more detailed telemetry about it. That means that the methods just keep going. I could pass the CTS to the tasks instead, or access it through other means, but that also feels a little messy.
Hope this makes sense.
3 replies
❔ Cross-platform 3D rendering library?
Hello, I am working on an application/tool to generate 3D models. I was wondering if there was a good library for 3D rendering, and showing that in a UI.
I know there is Silk.Net. But that seems a bit too low level for me (not a graphics/rendering guy at all).
And on the other end, I also know that Avalonia has trouble showing 3D renders.
Any suggestions to solve these issues? Would I be best to use a game engine like Godot, even if I would have to roll my own UI binding system, and don't need any of the other features a game engine has? Thanks!
7 replies