Forum > Third party

Alternative set of string-to-int conversion routines

<< < (3/16) > >>

Ok, I get it, I need to think about it some more. In any case, there is no problem to roll back to the previous version.
But I really want everything to be in one self-sufficient unit.

In principle, using generics (as I suggested too) should not have a speed penalty at all.


--- Quote from: Thaddy on January 20, 2022, 04:38:47 pm ---In principle, using generics (as I suggested too) should not have a speed penalty at all.

--- End quote ---

In principle. In practice I find that debug sessions on my code regularly take me through the generics unit, which suggests that it /does/ interpose code in various places even when not used explicitly.


Lyrical digression.
As I mentioned above, I had a desire to create a faster function for converting a string to an integer quite a long time ago, or more precisely, at the time of this epic story.
At that time, in order to defeat Windows file mapping in the company with NtDll, it came to some completely crazy decisions.
I hope now it can be done without much straining.


--- Quote ---Int32:
Val(), score:        3073
rejected:            0

TryChars2Int, score: 1486
rejected:            0

sc_StrToLongWord or sc_StrToInt, score: 1104
rejected:            0

Val(), score:        3075
rejected:            0

TryChars2Int, score: 1627
rejected:            0

sc_StrToQWord or sc_StrToInt64, score: 1072
rejected:            0

Press any key to exit...

--- End quote ---
Я проверил свой код в вашей демке. Не воспринимайте это как "вызов". Ваш код людям нравится больше. И они считают, что вашим кодом можно "выдёргивать" цифры из текста. Возможно они правы.
Не всегда "вычурные" решения бывают самыми лучшими. При переводе строк, табличными значениями удобно пользоваться только в шестнадцатеричной системе. Ваш код помог мне решить несколько мелких проблем в моём коде. Хотя идеи далеко не новы... я просто забыл о них.
google translate:
I checked my code in your demo. Don't take it as a "challenge". People like your code more. And they think that your code can "pull out" numbers from the text. Perhaps they are right.
Not always "artsy" solutions are the best. When translating strings, it is convenient to use table values only in the hexadecimal system. Your code helped me solve a few small problems in my code. Although the ideas are far from new... I just forgot about them.


[0] Message Index

[#] Next page

[*] Previous page

Go to full version