Working with Spans and Strings

Поділитися
Вставка
  • Опубліковано 31 тра 2024
  • Salih shows us how and why we need to use Spans when we are evaluating strings.
    Chapters:
    0:00 - Introduction
    1:20 - Reviewing how strings are immutable
    4:45 - Reviewing how memory works
    5:45 - Introducing the lists of strings we will process
    7:55 - Reviewing how spans work
    10:00 - Processing the list of strings using Substring
    14:15 - Processing the list of strings using Split
    15:25 - Processing the list of strings using Regex
    16:00 - Processing the list of strings using Span
    20:20 - Benchmarking the different options
    22:15 - Wrap-up
  • Наука та технологія

КОМЕНТАРІ • 27

  • @ahmad-murery
    @ahmad-murery 5 місяців тому +3

    I learned something new today,
    Using Spans looks very logical in some cases.
    Please bring up more of these topics to the channel.
    Thanks you Robert and Salih!

    • @TechBuddyTR
      @TechBuddyTR 5 місяців тому +1

      Spans are very efficient tools if you know to get the best out of it :)

    • @ahmad-murery
      @ahmad-murery 5 місяців тому +1

      @@TechBuddyTR Indeed, it reminds me of the old days where we try to save every bit of the memory when the whole system has 64K RAM.
      You did a great job demonstrating different approaches to solve the same problem so that one can appreciate using Spans.
      Please consider making more videos like this (In English if possible)
      Thanks Salih👍

    • @TechBuddyTR
      @TechBuddyTR 5 місяців тому +1

      @@ahmad-murery I've over 250 videos in Turkish tho but I'm planning to start making videos in English in 2024 as a new year goal :) Stay tuned

    • @ahmad-murery
      @ahmad-murery 5 місяців тому

      @@TechBuddyTR Nice, Consider me subscribed🚀

  • @valihank
    @valihank 5 місяців тому +3

    Awesome! Straight to the point with great code example 👍

  • @yasarmas963
    @yasarmas963 5 місяців тому +3

    thank you salil cantekin for this beautiful content

  • @atalantado
    @atalantado 5 місяців тому +2

    Great! Robert and Salih, thank you very much.👍

  • @enesceb
    @enesceb 5 місяців тому +2

    Thanks Mr.Salih 🚀

  • @rahimliparviz
    @rahimliparviz 5 місяців тому

    thanks, awesome explanation

  • @stevknot1
    @stevknot1 5 місяців тому

    Increíble, pero yo quisiera saber, donde puedo ver esa información tan detallada en Microsoft?? la documentación que eh visto, no da una explicación.

  • @nikolayrogchev9628
    @nikolayrogchev9628 5 місяців тому

    Great video! What about memory leaks though, what if a class needs a substring, it will hold a reference to the string, this means the original string will stay in memory without being collected, right?

    • @TechBuddyTR
      @TechBuddyTR 18 днів тому

      Span itself is a Struct already. So once it's used, it's removed from Stack, which means the reference of the original string is not stored anywhere so it can be collected.

  • @Sp1tfire100
    @Sp1tfire100 4 місяці тому

    Is this a theme of visual studio he is using or default theme?

  • @SpaceSoftSystem
    @SpaceSoftSystem 5 місяців тому

    hello sir / madam
    i am visual studio ( VB ) software developer
    i create a application , there 3 to 4 png image, when i put it one by one ( with background color Transparent ) its show my form background not image Transparent, i think your software developer not use photoshop or CorelDraw application (Layer 1 , Layer 2 , Layer 2 )
    when i move Layer 1 , Layer 2 or Layer 3 its not show page background ( Control background ) its show behind image background into Transparent color , same in android studio application , for this type work why i use unity or other software , please update picture box and image box property
    i hope you understand what i want.

  • @BasvanderVeeken
    @BasvanderVeeken 5 місяців тому

    Of course there are memory allocations, but not for handling new strings, which we see in the final result that there are still 16 kB of int/DateTime allocations.

    • @TechBuddyTR
      @TechBuddyTR 18 днів тому +1

      int and DateTime are value types so don't cause any allocation on heap. That 16kb was something else :) we still had to create string allocation, which was the reason

  • @adilatman
    @adilatman 5 місяців тому +2

    "I'm form 🇹🇷" daha hoş olurdu. Neyse takılmıyoruz bunlara, tebrikler Salih hocam 👍

    • @TechBuddyTR
      @TechBuddyTR 5 місяців тому +1

      Nerede yaşadığımı söylüyorum aslında :)

  • @Netryon
    @Netryon 5 місяців тому

    WIll it be your ideas Citus Altius Fortius, because that building is university campus computer center and it's not my part time or full stack developer (Who shows all the cards to everybody beginning the game) job or hobby after the work, because now I want to meet you again after the holidays Kit Club, because getting into that company is as rotary club for VIP as it was into college for every alumni for outerbanks pogues obviously who are hired to serve the food for Iskaara

  • @Netryon
    @Netryon 5 місяців тому

    There is nothing to know, but bikini is covering whole body so let me forget all the Havoc and Vengeance behind a school windows in the classroom - Ukrane or Iran I don't care... My life calling is coding. My problem is not this assigning value, my problem is how can find every video of Gitanas Nausėda and print it as a list. So German or Russia - you don't want that and I may ask to propose three or more business proposals until the presidential election next year, because it's not my hobby, but a denial to be able to get this .NET career and I don't understand why, but maybe my IVY bridge CPU knows. 6:10 I will let them know only if they are followers if(not){Must dig in the text as Looam Niffen} 6:10, but you pretty nothing here as a rock star to seek you.