-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from maxmind/greg/prepare-for-1.0.1
Prepare for 1.0.1
- Loading branch information
Showing
20 changed files
with
487 additions
and
390 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
using System; | ||
#region | ||
|
||
using System; | ||
using System.Net; | ||
|
||
#endregion | ||
|
||
namespace MaxMind.Db.Benchmark | ||
{ | ||
class Program | ||
internal class Program | ||
{ | ||
static void Main(string[] args) | ||
private static void Main(string[] args) | ||
{ | ||
using (var reader = new Reader("GeoLite2-City.mmdb", FileAccessMode.MemoryMapped)) | ||
{ | ||
var count = 100000; | ||
var rand = new Random(); | ||
var start = DateTime.Now; | ||
for (int i = 0; i < count; i++) | ||
for (var i = 0; i < count; i++) | ||
{ | ||
var ip = new IPAddress(rand.Next(int.MaxValue)); | ||
if (i % 50000 == 0) | ||
if (i%50000 == 0) | ||
Console.WriteLine(i + " " + ip); | ||
|
||
var resp = reader.Find(ip); | ||
} | ||
|
||
var stop = DateTime.Now; | ||
Console.WriteLine("Requests per second: " + count / (stop - start).TotalSeconds); | ||
Console.WriteLine("Requests per second: " + count/(stop - start).TotalSeconds); | ||
} | ||
} | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Newtonsoft.Json" version="6.0.5" targetFramework="net40" /> | ||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net4" userInstalled="true" /> | ||
</packages> |
Oops, something went wrong.