This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dddBlumenau = new DDD(47); | |
var dddSaoPaulo = new DDD(11); | |
heueheue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
[DataContract] | |
public class Album | |
{ | |
[DataMember] | |
public string Titulo { get; set; } | |
[DataMember] | |
public int AnoDeLancamento { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
[DataContract] | |
public class Album | |
{ | |
[DataMember] | |
public string Titulo { get; set; } | |
[DataMember] | |
public int AnoDeLancamento { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const int TotalDeAlbuns = 100000; | |
private static readonly List Albuns = Enumerable.Range(0, TotalDeAlbuns).Select(x => CriarAlbum(x)).ToList(); | |
private static Album CriarAlbum(int numeroDoAlbum) | |
{ | |
return new Album {AnoDeLancamento = numeroDoAlbum, Titulo = numeroDoAlbum.ToString()}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void TestesComProtobufNet() | |
{ | |
var albunsSerializados = new List(); | |
var albunsDesserializados = new List(); | |
Contador.Iniciar(); | |
foreach (var album in Albuns) | |
{ | |
using (var memoryStream = new MemoryStream()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void TestesComProtobufBinaryFormatter() | |
{ | |
var albunsSerializados = new List(); | |
var albunsDesserializados = new List(); | |
var binaryFormatter = new BinaryFormatter(); | |
Contador.Iniciar(); | |
foreach (var album in Albuns) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void TestesComDataContractSerializer() | |
{ | |
var albunsSerializados = new List(); | |
var albunsDesserializados = new List(); | |
var dataContractSerializer = new DataContractSerializer(typeof (Album)); | |
Contador.Iniciar(); | |
foreach (var album in Albuns) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void TestesComXmlSerializer() | |
{ | |
var albunsSerializados = new List(); | |
var albunsDesserializados = new List(); | |
var xmlSerializer = new XmlSerializer(typeof (Album)); | |
Contador.Iniciar(); | |
foreach (var album in Albuns) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Para descobrir se o sistema operacional é 64 bits é só fazer | |
Environment.Is64BitOperatingSystem | |
//E para saber se o processo é 64 bits: | |
Environment.Is64BitProcess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Obsolete("This method is obsolete; use method Register instead.")] | |
public Container Map<T>() | |
{ | |
_baseType = typeof (T); | |
return this; | |
} |