Friday, January 19, 2018

C# .NET System.IO.Path.GetFileName vs LastIndexOf Performance Comparison

Surprise, LastIndexOf can be 10 orders of magnitude slower than Path.GetFileName, if you use  a string "\\"  instead of a character '\\'. 

Code for SEO and when service will eventually shut down
using System;
using System.Diagnostics;
using System.IO;

public class Program
 public static void Main()
  string path = @"C:\test.txt"; 
  string filename = ""; 
  Stopwatch x1 = new Stopwatch();
   filename = path.Substring(path.LastIndexOf("\\") + 1);  
  Stopwatch x2 = new Stopwatch();
   filename = filename = Path.GetFileName(path);   
42 ticks
8 ticks

Friday, January 12, 2018

Intel Official Meltdown and Spectre Performance Decrease Spreadsheet

Intel Benchmark Table*

Note: The data above is based on multiple runs and expected system benchmark variation is assumed to be +/- 3%. So 3% margin of error is huge for a system.

This number means nothing however without knowing the Confidence Interval.

*Get Full Spreadsheet PDF here

Intel Official Release :

Thursday, January 11, 2018

Amazon Phishing Email: Please verify your details

For the record, this is an Amazon phishing email attempt that is recently going around. What to do?  Report them, go to the bottom of page.

From: []
Subject:  Please verify your details
Sent : Jan 10, 2018
Based on your recent activity, a part of your details are missing or has been modified. To avoid any delays of your orders or account suspension, follow the link to update and verify your details.
Amazon Help Center Spam Link points to 
If needed, update your information with the card issuer
This can happen when you sign in for the first time on a new computer, phone or browser, when you use your browser's incognito or private browsing mode or clear your cookies.
Thank you for shopping at,
  Amazon Customer Service

Microsoft SmartScreen 

Here's how the link look like in, it's wrapped in a SmartScreen forwarding URL that check for the validity and security of the link

The actual link is

Here's how the phishing site looks

At the time of reporting this Microsoft's SmartScreen, reported this unsafe  and we get this screen. Protecting us from damage.

IE is better than Google for phishing detection
If by chance you navigate to 

Google Chrome will let you to the site, where as in IE you get the above.

Microsoft's Internet Explorer the built-in SmartScreen will give you the above website unsafe message.

In Chrome, there's no such restrictions and the site looks like this. 

How to tell this is a Phishing email ?

  1. Check email address in full, if it's not from originating company then it's phishing.
  2. Hover over all links in email, if it's not from the site then forget it.

  3. The best way is to look at message source, see below.

How to examine Email Message Source ?

Now lets look at message source
  1.>Actions->View Message Source. 
  2.>More (down arrow to top right)->Show original.
Check for suspicious links, anything that does not originate from

Report Phishing Email (not as Spam)

  1.>Junk (at Top)->Phishing Scam
  2.>More (downarrow to top right)->Report Phishing 

Report Phishing URLs at Google now 

If you have recievied this email take further action now by click these links


Report phishing at Microsoft and government agencies


Report phishing emails to Apple 

Forward the email to This provides Apple's legal department and law enforcement with useful information to help prevent future phishing emails.