|
SSE 4.2 is overrated though. The instructions are neat, but they don't execute very quickly. There are also no AVX2 equivalents, just a VEX-encoded version of the 128bit operations. Overall, SSE 4.2 usually doesn't work out that well, though it has niche uses, and it turns out that the PCMPEQB & PMOVMSKB combo wins. It's a bit more boring perhaps, but it turns out that just because something is made for a particular purpose, that doesn't make it the best for that purpose.
Glibc also uses generic instructions instead of the SSE 4.2 special stuff.
|
|
|
|
|
In the end I didn't have to worry about it. I found out how optimized strpbrk() is and I'm using it over a memory mapped file. I'm searching through JSON picking out fields about 560MB/s now
That's satisfying enough, and more portable (memory mapped stuff isn't 100% but i have code for windows and i think either posix or linux so it works with both and falls back)
Real programmers use butterflies
|
|
|
|
|
Message Removed
modified 27-Dec-20 15:11pm.
|
|
|
|
|
Edit: This might be useless. I just found out simdjson's new API supports demand streaming like my library does. The only advantage mine has is it will run on tiny devices.
---------- SNIP
and it's called eliminating branches.
I'm creating a utf8 decoding routine based on some wicked code I found here
branchless-utf8/utf8.h at master · skeeto/branchless-utf8 · GitHub[^]
Black magic it is. I wouldn't be surprised if the compiler vectorizes this and turns it into simd instructions
So now I just need to do some 4 byte windowing without branches. I think i just need between 1 and 4 bit shifts to do it. I need to think on it though. I love this stuff.
I've already sped it up:
utf8 scanned 20383269 characters in 120.909000 ms at 157.142975MB/s
It could be a lot faster though: (currently my code branches)
raw ascii i/o 20383269 characters in 57.367000 ms at 331.200865MB/s
This is the holy grail. I'd be happy with 1GB/s:
raw ascii block i/o 19 blocks in 3.070000 ms at 6188.925081MB/s
I'm using memory mapped files now for speed, which helps significantly but branching is killing me in my decoding routine.
Optimizing still matters.
Watch me hit 1GB/s soon... hopefully.
The reason I'm doing this by the way, is I think I have a better high level algorithm for processing JSON. I've built a better mousetrap, I'm pretty sure.
The problem is to bench it I need to compete with simdjson at a lower level (i/o and decoding) since it's the gold standard in performance for JSON processing so far.
Real programmers use butterflies
modified 27-Dec-20 12:27pm.
|
|
|
|
|
Pretty cool stuff you're doing here , was this all spawned by your pump monitoring project ?
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
Thank you.
It wasn't exactly.
I wanted a JSON processor that was better about memory use than ArduinoJSON, and more portable. I've accomplished that in spades, but now I want to make it faster.
Real programmers use butterflies
|
|
|
|
|
You do realise you are mad
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
Quite.
Real programmers use butterflies
|
|
|
|
|
I'll be trying to build a screen capture utility for users to make error reports. Not very complex: they'll click an icon and it will grab the entire screen (with error message(s) ) and email (SMTP) it to IT Support. To be built with VS2015. The user's only interaction will be that of clicking the icon and it will not do any sort of screen display (no sizing or any of that required).
I googled a bit and there are quite a few free of libraries out there - has anyone here used any of them, and if so, can they recommend some library (or warn me away) ?
This is a bit of a COVID fallback position: the normal portal I built them allows for a user to submit a problem for another user (such as in an adjacent cubicle) - not nearly so useful when people are working from home.
[EDIT]
It worked by adapting How to capture the current screen using Windows Forms | DotNetCurry[^] to VS2015 - The screen is grabbed before the window opens and the window is to serve as an acknoledgement to the user that something happened. This code is from a much older version of VS, before gcnew, '^', and a few other things that are no longer valid
[/EDIT]
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
modified 4-Jan-21 14:30pm.
|
|
|
|
|
Windows comes with a snipping tool. Just have them use that.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I can't even get our field service people to use that. I consistently get error reports with 'screen captures' that were taken with a phone camera from three feet away.
Software Zen: delete this;
|
|
|
|
|
So do I and I built in the capability to save the current window with one click of a button on the main display. Somehow that escapes them.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
As Gary Wheeler observed, in his reply, and I put to another reply not dissimilar to yours.
The Lounge[^]
The idea is if the users has a problem (error on screen) they click a button - probably in the tool bar, and the rest is all done for them (capture->save->email). The only the windows built-in becomes useful is if I can invoke it and do the rest in code.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
BitBlt
I'd rather be phishing!
|
|
|
|
|
|
|
New (picture) categories: certain error; maybe; suggestion; cat; etc.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I added a button to my app to save window images as PNG files. I use C++ and the Ximage library I found here.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
ShareX - The best free and open source screenshot tool for Windows[^]
I wouldn't even bother to write one (though if you wanted to play with it, the source code is in C#.) It's fantastic, and has a configurable "workflow" - copy to clipboard, save to file, etc.
So my recommendation is, just have your users download it or similar free products already out there.
|
|
|
|
|
The users aren't supposed to see anything for the screen shot - I will likely put up a "sent" message after I SMTP the file but the idea is to minimize their participation (i.e., need to think).
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Ya know, I wrote a WPF customizable Message box article, and I was toying with making the MessageBoxImage icon clickable (in fact, I have most of the mechanicals for it are already implemented. The action performed in response to the click could be anything you want, such as sending the displayed error message to the support team, or even taking a screenshot, if that's what you really want to do. I personally think a detailed and properly crafted error message would be better, but hey, that's just me.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
#realJSOP wrote: if that's what you really want to do. I personally think a detailed and properly crafted error message would be better, but hey, that's just me. The problem is: Who is going to write that carefully crafted error message ?
The brain-trust that make up the typical employee cadre where I work, and probably most anyplace that that isn't full of techies, can hardly frame a valid question if it's not a text message in both quality and utility.
Or, as I should have put it: the dumb asses don't know how to do anything and, working from home, no one is around to hold their hand to get them through it.
So - of course - what you think should be done would really be great. If only there were someone on the other end who can handle it.
Note: Screen-capture part finally worked out to my satisfaction. SMTP mail is next.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
... there are only 363 days left until Christmas ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'm good. Done all the preparations already...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
I do like your Signature.
"Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980
|
|
|
|