[Include] y_stringhash - Fast string comparisons.
#9

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
****** is right but I don't understand the purpose of comparing a lot of strings with this way

Код:
[21:00:16] [1] Finished in 65ms
[21:00:16] [2] Finished in 71ms
The purpose is simple - its faster in runtime.

As the first few lines of the thread say "its faster to compare integer against integer than string"

Hash by itself is a bit of slowdown, I am not sure why ****** didn't save the results (of _H<>) in an array (maybe because of proper code readability), but if you have lots of conditional strings stacked one after another in a linear manner, using y_stringhash can surely speed things up.

Your code does what Meller's one does and you can't really see the benefit of it that way, try to stack all of the conditional one after another without using loop and then benchmark it.


Quote:
Originally Posted by Riddick94
Посмотреть сообщение
What's the "YHash" function string limit? Seems like I can't go over 16 characters. I am trying to do: 'case _H<COLT45_CROUCHFIRE>:'
I guess the only solution is breaking them into two and adding them back together (?)
Reply


Messages In This Thread
y_stringhash - Fast string comparisons. - by corne - 17.04.2015, 19:17
Re: y_stringhash - Fast string comparisons. - by Kaperstone - 12.07.2017, 22:21
Re: y_stringhash - Fast string comparisons. - by Meller - 12.07.2017, 22:29
Re: y_stringhash - Fast string comparisons. - by xMoBi - 13.07.2017, 09:36
Re: y_stringhash - Fast string comparisons. - by Dayrion - 15.07.2017, 19:06
Re: y_stringhash - Fast string comparisons. - by PT - 15.07.2017, 22:54
Re: y_stringhash - Fast string comparisons. - by Astralis - 15.07.2017, 23:14
Re: y_stringhash - Fast string comparisons. - by Riddick94 - 16.07.2017, 15:43
Re: y_stringhash - Fast string comparisons. - by Kaperstone - 16.07.2017, 16:06
Re: y_stringhash - Fast string comparisons. - by Y_Less - 16.07.2017, 18:47
Re: y_stringhash - Fast string comparisons. - by Riddick94 - 18.07.2017, 18:06

Forum Jump:


Users browsing this thread: 1 Guest(s)