mikernet
mikernet
CC#
Created by Green Leaf on 12/19/2024 in #help
Why lambda is faster than other approaches?
i.e. in real world code you might have more than one implementation of the comparer interface/delegate fighting for dominance in which case the devirt PGO optimizations won't be as effective as they are in your benchmarks where one implementation of the comparer clearly dominates in frequency of calls and thus is the clear choice for prioritizing for devirt for PGO
10 replies
CC#
Created by Green Leaf on 12/19/2024 in #help
Why lambda is faster than other approaches?
All the advice above applies regardless. It might just be harder to gauge how much the PGO optimizations actually apply in typical real-world usage of the code.
10 replies
CC#
Created by Green Leaf on 12/19/2024 in #help
Why lambda is faster than other approaches?
You can add the memory diagnoser to BDN to see allocations.
10 replies
CC#
Created by Green Leaf on 12/19/2024 in #help
Why lambda is faster than other approaches?
Making your comparer a struct instead of a class isn't helpful, and is actually hurting things. Your comparer benchmark has an unnecessary boxing operation and allocation on every iteration right now. Change it to a sealed class and use the typical singleton comparer pattern instead. Besides that, delegate calls have always been faster than interface calls. The heuristic I use is that a virtual interface call has about twice the overhead of a virtual delegate call or virtual class call, so that is something to consider. Net8+ kind of complicates things in terms of benchmarks reflecting actual real-world performance and figuring out exactly "why" X is benching faster than Y with all the dynamic PGO devirtualization stuff going on as well. There's a lot of JIT magic happening these days that optimizes stuff.
10 replies
CC#
Created by GolemMan on 12/18/2024 in #help
wpf elements with a vertical alignment of top aren't exactly at the top and have a weird gap.
But I agree with the general sentiment. I was also on the "hot reload only" XAML wagon until a couple weeks ago.
113 replies
CC#
Created by GolemMan on 12/18/2024 in #help
wpf elements with a vertical alignment of top aren't exactly at the top and have a weird gap.
It's like designer and hot reload in one
113 replies
CC#
Created by GolemMan on 12/18/2024 in #help
wpf elements with a vertical alignment of top aren't exactly at the top and have a weird gap.
Uno Hot Design is actually pretty damn slick. Uno made designers great again. It embeds the designer into the running application in debug mode and you toggle it with the debug toolbar. Your changes are to the actual live application. The XAML designer revolution is coming, albeit for WinUI / Uno 😄
113 replies
CC#
Created by Pkzoid on 12/19/2024 in #help
created a basic C# .NET WinForms app to clean system files like temp, prefetch, and cache.
You need to be specific about what issue you are currently running into.
3 replies
CC#
Created by Pkzoid on 12/19/2024 in #help
created a basic C# .NET WinForms app to clean system files like temp, prefetch, and cache.
Your question is too broad to be answered in any useful way. 1) Learn C# 2) Learn WinForms 3) Add checkboxes to a form in WinForms 4) Write the code to delete selected system files.
3 replies
CC#
Created by yumo on 2/23/2023 in #help
❔ login system saves data from user
Thats because you didnt select id as the first column
15 replies
CC#
Created by yumo on 2/23/2023 in #help
❔ login system saves data from user
id, realname, nivel
15 replies
CC#
Created by yumo on 2/23/2023 in #help
❔ login system saves data from user
So select 3 columns
15 replies
CC#
Created by yumo on 2/23/2023 in #help
❔ login system saves data from user
Well you're reading 3 columns
15 replies
CC#
Created by yumo on 2/23/2023 in #help
❔ login system saves data from user
It's better to select the columns instead of relying on the order that * returns them in
15 replies
CC#
Created by Anton on 2/23/2023 in #help
❔ WPF draw over other arbitrary controls
There's some good info here that you can use: http://drwpf.com/blog/2008/07/20/itemscontrol-g-is-for-generator/
53 replies
CC#
Created by Anton on 2/23/2023 in #help
❔ WPF draw over other arbitrary controls
So it puts the item into a container and overlays the checkbox on top
53 replies
CC#
Created by Anton on 2/23/2023 in #help
❔ WPF draw over other arbitrary controls
You can modify the container it generates for each item
53 replies
CC#
Created by Anton on 2/23/2023 in #help
❔ WPF draw over other arbitrary controls
Ok, then why can't you wrap whatever you have inside the item template with something that overlays the checkboxes?
53 replies
CC#
Created by Anton on 2/23/2023 in #help
❔ WPF draw over other arbitrary controls
Does it need to be an ItemsControl or can you subclass ItemsControl and use that?
53 replies