-
Notifications
You must be signed in to change notification settings - Fork 522
Seek with Vector is 5 times slower then 'normal' Seek #512
Comments
Been doing some benchmarks around into this; a change needed for the current version is the vectors need to be passed by e.g. if you see any time spent in the Vector.ctor then isn't not using the fast path. |
Also you need to be running x64 (+RyuJIT) for Vectors to mean hardware acceleration (and currently Windows) |
You are right about the non-optimal shorter than vector path though. |
I ' am running core clr release. Do I also need to install x64 (+RyuJIT)?? I will check that I did some test for both seek functions with the program below.
test program
|
For coreclr you need to have the x64 runtime as the active one. Easiest way is to do:
Also add the line:
To make sure its accelerated; after compiling in Release with optimizations, run your program at the command line and see the output. Also try with: |
Thx IsHardwareAcclerated== false on my system. will look at this later, Have to go now I am now running on core clr 64
|
@benaadams After enabling factor the result are more with what I expected Search for string with 16 chars is at the same speed Vector.IsHardwareAcclerated == True
|
@Anderman I'd reopen as it is slower than it needs to be when the length to be scanned it |
@benaadams, I can create a new PR for that? Or... did you already fix that?
Any thoughts about it
|
@Anderman should be fixed in #514
I have wondered in this, but currently its a ptr and an int; which would have to be passed anyway; so would increase the params required per function, but not sure if any gain. The
Worth investigating |
I was looking for performance gains. Because for small strings there is some overhead in setting up the vector and finding the first byte.
But, I found out that the difference is also true for a long string.
Probably I do something wrong. But all test still working after changing the code
normal search
The text was updated successfully, but these errors were encountered: