Esempio n. 1
0
        private static void Main(string[] args)
        {
            if (false)
            {
                using (MemoryStream ms = new MemoryStream())
                {
                    using (FileStream file = new FileStream(PathResolver.TestProcessedFile, FileMode.Open, FileAccess.Read))
                    {
                        byte[] bytes = new byte[file.Length];
                        file.Read(bytes, 0, (int)file.Length);
                        ms.Write(bytes, 0, (int)file.Length);
                    }

                    InputFileOpener opener = new InputFileOpener(new BinaryReader(ms), new LinkSorter(null, null));

                    return;
                }
            }

            var watch = Stopwatch.StartNew();
            //start();
            var filename = PathResolver.TestProcessedFile + "2";

            using (var opener = new InputFileOpener(filename,
                                                    new OutputGenerator(PathResolver.OutputPath)))
            {
                opener.Read();
            }

            watch.Stop();
            Console.WriteLine("Done after {0}", watch.Elapsed);

            Console.ReadLine();
        }
Esempio n. 2
0
        private static void Process(List <BinarySearchSet <int> > groups, StreamWriter writer)
        {
            var watch    = Stopwatch.StartNew();
            var filename = PathResolver.TrainProcessedFile;

            using (var opener = new InputFileOpener(filename,
                                                    new OutputGenerator(PathResolver.OutputPath)))
            {
                opener.Read();
            }
            watch.Stop();
            int nGroups = groups.Count;

            groups.Clear();
            GC.Collect();
            Console.WriteLine(nGroups + " groups processed in " + watch.Elapsed);
        }