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 8768867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:10:45+00:00 2026-06-13T17:10:45+00:00

I am working on a code base with a lot of ForEach… If’s .

  • 0

I am working on a code base with a lot of ForEach... If's. I was planning to convert them to filtered for each’s but I wanted to know is the speed improvement worth the time. I know all of these things are relative but if the filtered for each is magnitudes faster in general it would make sense to change.

 For Each egg In chicken.Where(Function(x) x.Tasty = True)
      ' Do Stuff
 Next

 For Each egg In chicken
      If x.Tasty = True Then
           ' Do Stuff
      End If
 Next
  • 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-13T17:10:47+00:00Added an answer on June 13, 2026 at 5:10 pm

    One thing you could try is use the StopWatch class to measure how long each For loop takes e.g.

    Dim sw As New Stopwatch()
    sw.Start()
    
    ' Do some work..
    sw.Stop()
    
    Console.WriteLine("Elapsed time to do some work: {0}", sw.Elapsed.ToString())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started working with a large code base, and a lot of the
I am working with a HUGE code base, developed by a LOT of people.
I'm working on a code base that has a lot of identical ConfigurationManager.AppSetting calls
I'm working with an inherited code base which contains thousands of lines of commented
I came across the following code in a code base I am working on:
We have a team of 40+ engineers working on a common code base. We're
Currently, I am working on restructuring an existing code base. I'm new to php
Working with Google Maps, I have the following code: var tileNames = [base, parking,
In the last year and a bit of working on my team's code base
I have large C code base for a micro-controller. I am working on a

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.