Click here to Skip to main content
15,921,467 members
Home / Discussions / C#
   

C#

 
GeneralRe: Rx SubscribeOn and ObserveOn Pin
Kenneth Haugland25-Feb-16 2:31
mvaKenneth Haugland25-Feb-16 2:31 
GeneralRe: Rx SubscribeOn and ObserveOn Pin
Pete O'Hanlon25-Feb-16 2:34
mvePete O'Hanlon25-Feb-16 2:34 
GeneralRe: Rx SubscribeOn and ObserveOn Pin
Kenneth Haugland25-Feb-16 4:38
mvaKenneth Haugland25-Feb-16 4:38 
SuggestionRe: Rx SubscribeOn and ObserveOn Pin
Matt T Heffron25-Feb-16 10:26
professionalMatt T Heffron25-Feb-16 10:26 
GeneralRe: Rx SubscribeOn and ObserveOn Pin
Kenneth Haugland25-Feb-16 10:33
mvaKenneth Haugland25-Feb-16 10:33 
GeneralRe: Rx SubscribeOn and ObserveOn Pin
Kenneth Haugland25-Feb-16 20:27
mvaKenneth Haugland25-Feb-16 20:27 
AnswerRe: Rx SubscribeOn and ObserveOn Pin
Matt T Heffron26-Feb-16 7:20
professionalMatt T Heffron26-Feb-16 7:20 
GeneralRe: Rx SubscribeOn and ObserveOn Pin
Kenneth Haugland25-Feb-16 20:55
mvaKenneth Haugland25-Feb-16 20:55 
QuestionIssue with retrieving items from an IEnumerable<T> Pin
RichardGrimmer24-Feb-16 3:27
RichardGrimmer24-Feb-16 3:27 
SuggestionRe: Issue with retrieving items from an IEnumerable<T> Pin
Richard Deeming24-Feb-16 3:50
mveRichard Deeming24-Feb-16 3:50 
GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
RichardGrimmer24-Feb-16 4:23
RichardGrimmer24-Feb-16 4:23 
GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
Richard Deeming24-Feb-16 4:34
mveRichard Deeming24-Feb-16 4:34 
GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
RichardGrimmer24-Feb-16 4:44
RichardGrimmer24-Feb-16 4:44 
GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
Pete O'Hanlon24-Feb-16 5:06
mvePete O'Hanlon24-Feb-16 5:06 
GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
RichardGrimmer24-Feb-16 5:34
RichardGrimmer24-Feb-16 5:34 
GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
RichardGrimmer24-Feb-16 20:15
RichardGrimmer24-Feb-16 20:15 
OK - I've cracked the issue, but I'm not even going to pretend I know why...it appears it was down to how I was populating my lists....

The pop code originally looked like;

var expandedEntities = Foontities.Select(entity => new ExpandedFoo
            {
                FooId = entity.fooId.ToString(CultureInfo.InvariantCulture),
                BarId = entity.BarId.ToString(CultureInfo.InvariantCulture),

                Title = entity.Title,
                Gender = entity.Gender,
                FirstName = entity.FirstName,
                LastName = entity.LastName,
                FullName = entity.FullName,

                OtherNames = entity.OtherNames,
                CombinedName = entity.CombinedName,

                Country = entity.Country,

                BlahId=  entity.BlahId.ToString(),

                DateOfBirths = (from DateOfBirth dob in dateOfBirths
                                where dob.FooId== entity.FooId
                                select new FooDateOfBirth()
                                {
                                    DateOfBirthId = dob.DateOfBirthId,
                                    Year = dob.Year,
                                    Month = dob.Month,
                                    Day = dob.Day
                                }).ToList()
            });

Which was causing the 12s time to extract 1000 records, but (as mentioned, this is to index into Elastic Search), converting to Json and building a bulk command using PlainElasic.net was <.2s....

Removing the ToList(), to make the DOB population code;

DateOfBirths = (from DateOfBirth dob in dateOfBirths
                                where dob.PooId == entity.FooId
                                select new FooDateOfBirth()
                                {
                                    DateOfBirthId = dob.DateOfBirthId,
                                    Year = dob.Year,
                                    Month = dob.Month,
                                    Day = dob.Day
                                })

Fixed the extraction problem and took the time to milliseconds - BUT caused the Json conversion and bulk command building to take (coincidentally) 12s...

HOWEVER, doing;

DateOfBirths = (from DateOfBirth dob in dateOfBirths
                                where dob.FooId == entity.FooId
                                select new FooDateOfBirth()
                                {
                                    DateOfBirthId = dob.DateOfBirthId,
                                    Year = dob.Year,
                                    Month = dob.Month,
                                    Day = dob.Day
                                }) as List<DateOfBirth>


Made it run in the region of .001s for both the extract and the convert and bulk command creation....

I think I need to look at the IL and see what's going on!

Many thanks to both you and Richard for all your help - if I can figure out the issue / differences, I'll post back and let you both know!

Thanks again gents!
C# has already designed away most of the tedium of C++.

GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
Pete O'Hanlon24-Feb-16 22:09
mvePete O'Hanlon24-Feb-16 22:09 
GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
RichardGrimmer26-Feb-16 4:28
RichardGrimmer26-Feb-16 4:28 
GeneralRe: Issue with retrieving items from an IEnumerable<T> Pin
RichardGrimmer24-Feb-16 20:16
RichardGrimmer24-Feb-16 20:16 
QuestionCapture a image fram from a local video using a button to transfer into a picturebox and then save into local disk in C#.NET Pin
Member 1209982523-Feb-16 20:57
Member 1209982523-Feb-16 20:57 
AnswerRe: Capture a image fram from a local video using a button to transfer into a picturebox and then save into local disk in C#.NET Pin
Pete O'Hanlon23-Feb-16 21:23
mvePete O'Hanlon23-Feb-16 21:23 
GeneralRe: Capture a image fram from a local video using a button to transfer into a picturebox and then save into local disk in C#.NET Pin
Richard MacCutchan24-Feb-16 1:16
mveRichard MacCutchan24-Feb-16 1:16 
AnswerRe: Capture a image fram from a local video using a button to transfer into a picturebox and then save into local disk in C#.NET Pin
Gerry Schmitz24-Feb-16 6:57
mveGerry Schmitz24-Feb-16 6:57 
QuestionDispose of RX subscriptions Pin
Kenneth Haugland23-Feb-16 2:28
mvaKenneth Haugland23-Feb-16 2:28 
AnswerRe: Dispose of RX subscriptions Pin
Kenneth Haugland23-Feb-16 2:32
mvaKenneth Haugland23-Feb-16 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.