The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Archive for the ‘.NET 4.0’ Category

Why Skylake CPUs Are Sometimes 50% Slower – How Intel Has Broken Existing Code – Alois Kraus

Posted by jpluimers on 2018/08/09

[WayBack] Why Skylake CPUs Are Sometimes 50% Slower – How Intel Has Broken Existing Code – Alois Kraus reports that the PAUSE instruction on Intel Skylake architecture takes an order of magnitude longer than on previous architectures.

This impacts spinlock code in .NET 4.x and .NET Core 2, and likely impacts other spinlock code as well. The .NET core fix gets back-ported to .NET 4.x.

Since Delphi XE, the Delphi RTL code has borrowed ideas from .NET implementing this kind of code, so I filed [WayBack] QualityCentral: 144063 PAUSE instruction on Intel Skylake takes order of magnitude longer: important for SpinWait/SpinLock code (because Google can index it).

It is no coincidence that a Senior Scaleability Engineer at Booking.com mentioned it on his G+ stream ([WayBack] The “Pause” instruction changed timing dramatically in Skylake. Spinlock implementation based on pause will need adjustments. – Kristian Köhntopp – Google+) as changes like this can heavily impact server systems.

–jeroen

via: [WayBack] The “Pause” instruction changed timing dramatically in Skylake. Spinlock implementation based on pause will need adjustments.I hope a fix for this will be back-ported for many Delphi versions. – Jeroen Wiert Pluimers – Google+

Posted in .NET, .NET 4.0, Delphi, Development, Software Development | Leave a Comment »

MiloszKrajewski/LibZ: the alternative to ILMerge (Resolve instead of merge assemblies)

Posted by jpluimers on 2017/05/30

ILMerge has all sorts of drawbacks with things like XAML, WPF, NHibernate, dynamically loaded assemblies and reflection.

Jeffrey Richter: Excerpt #2 from CLR via C#, Third Edition | Microsoft Press blog has an interesting approach based on adding a callback to the AppDomain’s ResolveAssembly event with some steps so you can embed assemblies as resources which you then – unlike ILmerge- dynamically resolve.

Those steps require a bit of manual labour which is taken away by MiloszKrajewski/LibZ: LibZ, the alternative to ILMerge.

The repository on github even compresses your assembly resources.

–jeroen

Posted in .NET, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Development, Software Development | Leave a Comment »

How to secure memory? – Medo’s Home Page

Posted by jpluimers on 2017/03/15

Sometime you might want to protect your data in memory – the greatest example is when dealing with anything related to passwords. It is simply not smart to keep that data around in a plain-text. In .NET there are multiple methods you can use for this purpose, starting with SecureString, ProtectedMemory, and my favorite ProtectedData.…

Source: How to secure memory? – Medo’s Home Page

via: Found this via +Ilya S a post from +Josip Medved – Stuff like this should be way built into an OS, and RTL’s should have a secureMalloc()… – Joe C. Hecht – Google+

–jeroen

 

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, C# 6 (Roslyn), Development, Software Development | Leave a Comment »

Windows 10 – language neutral batch file to start Windows Update

Posted by jpluimers on 2017/02/22

A while ago, I bitched that Microsoft moved away the Windows Update out of the Control panel into a language depended place (in Windows 10 1511 update broke the Hyper-V networking – Fix network connection issues).

Since then I had to maintain too many locales running Windows 10. So here is the batch file:

for /f "delims=" %%A in ('PowerShell -Command "(Get-Culture).Name"') do explorer "%LocalAppData%\Packages\windows.immersivecontrolpanel_cw5n1h2txyewy\LocalState\Indexed\Settings\%%A\AAA_SystemSettings_MusUpdate_UpdateActionButton.settingcontent-ms"

It uses these tricks:

  1. Set output of a command as a variable (in this case a for loop variable)
  2. Execute PowerShell script in a .bat file
  3. PowerShell Get-Culture (which gets a .NET CultureInfo instance)
  4. CultureInfo.Name property (which has the nl-NL, en-US, etc codes in it)

It replaced this simple batch-file which has worked for like 10 years:

%windir%\System32\rundll32.exe url.dll,FileProtocolHandler wuapp.exe

–jeroen

via: Windows Update Shortcut – Create in Windows 10 – Windows 10 Forums

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, Batch-Files, CommandLine, Development, Power User, PowerShell, Scripting, Software Development, Windows, Windows 10 | Leave a Comment »

.NET/C# some links on querying the ActiveDirectory

Posted by jpluimers on 2016/12/15

Without dsquery installable, I had to query an ActiveDirectory spanning two domains.

Here are some links that helped:

–jeroen

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C# 6 (Roslyn), Development, Software Development | Leave a Comment »