Exemplo n.º 1
0
        public void PersistLoggingMaxPerformance()
        {
            if (IsOdbc)
            {
                return; //TODO temporary skipped
            }

            var ea = new EntityA();

            TestBase.TestSerialization(ea);

            var eb = new EntityB();

            TestBase.TestSerialization(eb);

            var rng = new Random();

            for (var j = 0; j < 5; ++j)
            {
                using (var em = Emf.CreateEntityManager())
                {
                    var mutatorSpec = new MutatorSpec(MutatorKind.Chunked)
                    {
                        Queued = true,
                        //// MaxCellCount = 8 * 1024,
                        MaxChunkSize   = 64 * 1024,
                        FlushEachChunk = true,
                        Capacity       = 32768
                    };

                    using (var ma = em.GetTable <EntityA>().CreateMutator(mutatorSpec))
                        using (var mb = em.GetTable <EntityB>().CreateMutator(mutatorSpec))
                        {
                            for (var i = 0; i < 100000; ++i)
                            {
                                ea = new EntityA();
                                rng.NextBytes(ea.Value);
                                ma.Set(new Key {
                                    ColumnFamily = "a"
                                }, Serializer.ToByteArray(ea), true);

                                eb = new EntityB();
                                rng.NextBytes(eb.Value);
                                mb.Set(new Key {
                                    ColumnFamily = "b"
                                }, Serializer.ToByteArray(ea), true);
                            }
                        }
                }
            }
        }
Exemplo n.º 2
0
        public void PersistLoggingMaxPerformance()
        {
            if (IsOdbc)
            {
                return; //TODO temporary skipped
            }

            var ea = new EntityA();
            TestBase.TestSerialization(ea);

            var eb = new EntityB();
            TestBase.TestSerialization(eb);

            var rng = new Random();
            for (var j = 0; j < 5; ++j)
            {
                using (var em = Emf.CreateEntityManager())
                {
                    var mutatorSpec = new MutatorSpec(MutatorKind.Chunked)
                        {
                            Queued = true,
                            //// MaxCellCount = 8 * 1024,
                            MaxChunkSize = 64 * 1024,
                            FlushEachChunk = true,
                            Capacity = 32768
                        };

                    using (var ma = em.GetTable<EntityA>().CreateMutator(mutatorSpec))
                    using (var mb = em.GetTable<EntityB>().CreateMutator(mutatorSpec))
                    {
                        for (var i = 0; i < 100000; ++i)
                        {
                            ea = new EntityA();
                            rng.NextBytes(ea.Value);
                            ma.Set(new Key { ColumnFamily = "a" }, Serializer.ToByteArray(ea), true);

                            eb = new EntityB();
                            rng.NextBytes(eb.Value);
                            mb.Set(new Key { ColumnFamily = "b" }, Serializer.ToByteArray(ea), true);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void PersistLogging()
        {
            if (IsOdbc)
            {
                return; //TODO temporary skipped
            }

            var ea = new EntityA();

            TestBase.TestSerialization(ea);

            var eb = new EntityB();

            TestBase.TestSerialization(eb);

            for (var j = 0; j < 5; ++j)
            {
                using (var em = Emf.CreateEntityManager())
                {
                    em.Configuration.MutatorSpec = new MutatorSpec(MutatorKind.Chunked)
                    {
                        Queued = true,
                        //// MaxCellCount = 8 * 1024,
                        MaxChunkSize   = 64 * 1024,
                        FlushEachChunk = true,
                        Capacity       = 32768
                    };

                    for (var i = 0; i < 100000; ++i)
                    {
                        ea = new EntityA();
                        Rng.Instance.NextBytes(ea.Value);
                        em.Persist(ea, Behaviors.CreateNew | Behaviors.DoNotCache);

                        eb = new EntityB();
                        Rng.Instance.NextBytes(eb.Value);
                        em.Persist(eb, Behaviors.CreateNew | Behaviors.DoNotCache);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public void PersistLogging()
        {
            if (IsOdbc)
            {
                return; //TODO temporary skipped
            }

            var ea = new EntityA();
            TestBase.TestSerialization(ea);

            var eb = new EntityB();
            TestBase.TestSerialization(eb);

            for (var j = 0; j < 5; ++j)
            {
                using (var em = Emf.CreateEntityManager())
                {
                    em.Configuration.MutatorSpec = new MutatorSpec(MutatorKind.Chunked)
                        {
                            Queued = true,
                            //// MaxCellCount = 8 * 1024,
                            MaxChunkSize = 64 * 1024,
                            FlushEachChunk = true,
                            Capacity = 32768
                        };

                    for (var i = 0; i < 100000; ++i)
                    {
                        ea = new EntityA();
                        Rng.Instance.NextBytes(ea.Value);
                        em.Persist(ea, Behaviors.CreateNew | Behaviors.DoNotCache);

                        eb = new EntityB();
                        Rng.Instance.NextBytes(eb.Value);
                        em.Persist(eb, Behaviors.CreateNew | Behaviors.DoNotCache);
                    }
                }
            }
        }