News for hackers. Stuff that matters.
Re:Yes, PHP is faster than C# by deltaci on Wednesday March 16, 2022 @07:54PM (#30705725)
but it makes function calls, it's not neglectable as it's called as many time as the bytes the file has
Re:Yes, PHP is faster than C# by withinboredom on Wednesday March 16, 2022 @07:58PM (#30705766)
That’s the api provided, and part of the point. The other option is to read the buffer directly, but it isn’t exposed to the programmer.
Re:Yes, PHP is faster than C# by h3h3 on Wednesday March 16, 2022 @08:03PM (#30705820)
the overload is right below it

  int StreamReader.Read()
  int StreamReader.Read(char[] buffer, int index, int count)
https://github.com/dotnet/runtime/blob/1ba0394d71a4ea6bee7f6...
Re:Yes, PHP is faster than C# by deltaci on Wednesday March 16, 2022 @08:00PM (#30705789)
You just need to do File.OpenRead instead of OpenText to get a FileStream, then you can read the buffer