m417z wrote: ↑Fri Nov 08, 2024 12:55 amWhich one of these is faster - querying 20k items at once or querying 20 items one by one - is a good question, but surely neither is optimal
This question kind of struck an amusing chord in my mind, so I did a simple test:
First, as a vague benchmark (it's awkward to create a separate timer thread just for this), I just roughly stopwatched a browsing into C:\Windows\WinSxS which on my system contains 16,400 folders, and letting my plugin query them consecutively took around 41 seconds, which essentially amounts to 41,000 milliseconds / 16,400 == 2.5ms, which is about what I expected given the margin for error.
It did, however, feel like clubbing a baby seal over the head; I guess the plugin passes the robust-ness test.
So setting up a specialised query of
parent:"C:\Windows\WinSxS" (collecting not just size but also path/name information since you'd have to sort it all out yourself later), Everything took (on my system) 10ms to return a 4MB chunk of WM_COPYDATA, with the relevant goodies inside. It would take a hilarious amount of void's pointer-math leapfrogging to sort this into bitesize pieces for you to munch on, but you get the idea.
The answer to your somewhat rhetorical question is 41,000 milliseconds vs. 10 milliseconds (plus a lot of sorting, which probably would take more time to think about than to actually execute).
Not sure if it's worth the trouble or not, but there you go.
m417z wrote:
Great,
borrowed, the new version is much better in all aspects - code size, stability and performance.
Hah, I've been chop-sueyed, spliced, daggered, and immortalised in code all at the same time - that was actually fun to read! Thanks for that. Glad it helped.
Incidentally, did you know that an expression of beauty like:
Code: Select all
g_gsReply.liSize = *(int64_t *)(((BYTE *)(list + 1)) + sizeof(EVERYTHING_IPC_ITEM2));
...really just ends up as a call to memcpy in the final ASM? Obviously you know that, of course, I'm just ranting - I found it rather depressing, but predictable. I like my way better.
![Smile :)](./images/smilies/icon_e_smile.gif)
(Though I'm miffed you prefer BYTE to the more elegant byte_t notation - to each their own!)
And thanks for the info on WindHawk - worth a look, for sure. Odd that I never heard of it before, but first time for everything.
Incidentally I've been following that mstorsjo / llvm-mingw project for awhile now, and it gets updates every couple of weeks (if you're into bleeding-edge LLVM stuff). Most people don't update their compilers that often, but it's nice the world keeps churning out toys for us muggles to mess around with.
![Wink :wink:](./images/smilies/icon_e_wink.gif)