(06-19-2015, 11:57 AM)Dia6lo Wrote: Okay, guys, it seems that you just can't give up on LFThat is a pretty good speedup, and yes I am not particularly good with C# as I greatly prefer C++. I just copied YinYin's code and fixed a few bugs in his code.. And I also noticed that you need some helping hand with C#, so I wrote a much faster program:
Here is comparison to Someone else's code(on davis.dat):
Code:My program: 9 ms
Someone else's program: 6297 ms
(06-19-2015, 11:57 AM)Dia6lo Wrote: As you can see, perfomance skyrockets by almost x700 times(mainly because you open file every time you read a single byte, while I do it only once).Are you sure that the code opens the file every byte?
I do not know much about C#, but I would imagine that it opens the file once, and then reads every byte separately, which is obviously still causes a major slowdown, but not nearly the same as opening the file each time a byte is read.
Good job on improving the code.
@below: Interesting.
Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.

Chat


. And I also noticed that you need some helping hand with C#, so I wrote a much faster program: