Jump to content

Fr0sT.Brutal

Members
  • Content Count

    2268
  • Joined

  • Last visited

  • Days Won

    46

Posts posted by Fr0sT.Brutal


  1.  

    2 hours ago, David Heffernan said:

    That does seem a strange design choice. If you can wait for at least one byte then surely you can wait for all requested.

    This design was made to handle streaming sources (socket, pipe, file being written, etc). At the moment of call there could be no data but next time it could arrive (I'm sure you know it anyway). But it really could puzzle those who are not aware of this behavior and are sure that Read() really waits until it reads requested amount of data.

    • Like 1

  2. I answered you in PM, so adding more specific info regarding ICS here: it is async so you have to setup message pump by yourself. I'm not sure ICS is the best choice here. Moreover, you have main DLL that loads child DLL via system's low-level functions (memorymodule) that itself loads SSL DLLs via regular LoadLibrary. It's just a nighmare Not the architecture I'd like to support

    If you only target Windows, why not try WinInet/WinHTTP - the short sync function will do all the network magic for you, without any exceptions (result code is returned). Moreover it will respect proxy settings of a target OS.


  3. You can setup counter and check it. The catch is that you never know how much space is occupied on the stack by single call. First I'd add logging of enters and leaves to that function and see whether it is really the source of problems. Then you'd have to decide whether this consumption is acceptable by algo (like matrix reverse - big matrix means big nesting, that's not an issue in algo but in input) or it's a algo's flaw (endless/excess recursion). In the former case you can try to optimize the code. Remember any local variable eats stack - probably you can reduce their number by using heap or object fields. Function parameters, if there's many of them, also consume stack so you can unite them into a record (but store it in heap otherwise it eats stack of the caller).


  4. Hmm, IMHO click-then-press is pretty weird sequence. This doesn't work neither in text editors nor with graphical tools I ever used. No surprise the system is not ready to handle it as you want it to.


  5. I watched the video in jumps but what I understood:

    - The guy needs specialized function to check if a word is from a very short set of predefined words

    - These words are latin

    - He uses "hash" as int32 = s[0],s[1],s[-2],s[-1] (inputs are ASCII/UTF8 but algo may also work with UTF16 with only 1st and last char used as hash) (hmm, but he'll got array of 2bil of pointers then...)

    - The hash is assumed to be unique for his set (he just takes wordlist[key] without any sub-arrays of items with the same hash)

    - And he also checks for 1st char before running full compare

    • Thanks 1

  6. 12 minutes ago, David Heffernan said:

    The thing is, how are you going to get to the stage where you have got a token that you know is a valid keyword?

    Well, I just watched it super quickly with rewind but my guess is that he optimizes a parser or something similar when software already got token that is known to be an identifier and he just wants to quickly check if it's a keyword.

     

    I wonder whether things would be even faster if he'd stored lengths of keywords and compared them before calling strncmp. That should give some gain on cases with similar first letter but different lengths

     


  7. 13 hours ago, David Heffernan said:

    The big change is Unicode. Everything else is simple. 

    That's why David suggested starting with D2010, I suppose. IIRC it had no significant changes compared to first Unicode D2009 but was, according to my personal impression, more stable.


  8. 8 hours ago, David Schwartz said:

    But keep in mind that a D7 app was targeting Win XP. Windows is four major releases beyond that, and lots of things have been deprecated if not eliminated

    Besides requirement of commandline to be modifiable in CreateProcess, I don't remember any significant breaking changes unless an app uses bad practice hacks like hardcoded system folders, running always as admin and so on. x64 could require transition to SetWindowLong. I'm not dealing much with advanced UI though, maybe more changes happened in that area


  9. Why you want to modify the code? If you encounter perf issues then profiler will help. If you have buggy areas - try static analyzer or AI or a programmer. If you want some fragments just simplified - well, why? To be more maintainable? Then just ask the maintainers 🙂

×