Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:16:37+00:00 2026-06-13T23:16:37+00:00

I have a set of data all doubles: 100 rows 20 columns I’m pulling

  • 0

I have a set of data all doubles:
100 rows 20 columns

I’m pulling the data into a IEnumerable list with:

var RowsOfData = File.ReadLines(dll.Globals.OutputDir +     dll.Globals.filename).Select(a => a.Split(',').ToList());

var FilteredRowsToday = (from n in RowsOfData
       where n[1] == 1
       orderby n[0] descending
       select n);

I then have a set of functions, which do simple check on each the data rows and each returns a Bool.
What I want is a count of the number of rows for which each of the functions evaluated true.
And then when I scale my project up I want this processed asap in parallel if possible, I’ve tried:

foreach (var row in FilteredRowsToday) {  
is f1() true, is f2() true 
etc
}

Seems slow
I’ve tried to do in parallel

foreach (var row in FilteredRowsToday.AsParallel())

no faster

I’m now thinking something like:

var TotalTrue = FilteredRowsToday.Select(item => f1() & f2() & f3()).Count();

I can pre-process the data to provide the results of the evaluations of each function as a sort of binary grid if that’s a better stating point?

F1, f2, f3 etc
1, 0, 0 row 1
1, 1, 1 row 2 etc

suggestions welcome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:16:38+00:00Added an answer on June 13, 2026 at 11:16 pm

    If you’re just interested in the count where all three functions evaluate to true, then this should be sufficient:

    var TotalTrue = FilteredRowsToday.Count(item => f1() & f2() & f3());
    

    As for why it’s slow, your functions could be the reason behind this.

    You could try only evaluating the rows until either all three functions return true, or at least one of them return false, e.g.

    var TotalTrue = FilteredRowsToday.Count(item => f1() && f2() && f3());
    

    I.e. If f1() evaluates to false, then don’t bother doing the rest of the validations.

    UPDATE: If your functions aren’t doing any resource-intensive checks, then parallel LINQ won’t do you much good (more info here).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of data points in 3D space which apparently all fall
I have a set of data, with columns x and y. This set contains
I have the following columns in my data set: presult aresult I single I
I have set the data to div element and append it to another div
I have a set of data, and while the number of fields and tables
I have a set of data and I want to find the biggest and
I have a set of data that contains garbled text fields because of encoding
I have a set of data in one JSON structure: [[task1, 10, 99], [task2,
I have a set of data that is structured like this: ItemA.GroupA ItemB.GroupA ItemC.GroupB
I have a set of data with over 1000 entries. I can filter these

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.