>>> import holdemresources_sevencardeval as handeval
>>> handeval.timedtrials()
133784560 hands counted with for loop in 0.7762000560760498 seconds
133784560 hands counted with for loop in 0.7375249862670898 seconds
133784560 hands counted with for loop in 0.7383525371551514 seconds
...
I’m kind of curious what Numba is actually doing with that code. I copied the code over to Rust, and it took 4.76 s without compiler optimizations, and 19 ms with. Now, 19ms is not enough time to do 10^8 additions, but also much too long to have optimized all the loops down to a single computation. So… kind of talking out of my ass here, but perhaps the inner loop gets vectorized into a single processor operation and the outside loops get flattened. Then you have ~2 million vector instructions plus ~2 million loop iterations, which seems reasonable. If Numba’s compilation time is included in that 216 ms, I would guess it has to be doing something similar and the nested loops are actually not in the final assembly code at all.
I haven’t used it, but if you are a C++ programmer you might look at WebAssembly for doing the front-end. I would guess that it would take much longer for development than JS though.
I started an app, and found that everything was changing between 1 and 2 or maybe it was 2 and 3. The next time I looked into it, like a year later, they were on version 6. It’s like the opposite of python2 4lyfe phenomenon, where the entire world bends over backwards for decades to support the old version.
hey, came from the old site tho i had maybe 200 posts over 10yrs, so you guys would not recognize my old name.
anyway, you could look into webGL, specifically, i can vouch for the Unity engine to be a good, performant solution for a game front end. i also checked and it seems unreal can build for webGL too, so this being C++ might be more up your alley. gotta say, C# is kinda neat actually, some nice stuff in there and easy to pick up.
main advantage would be , it’s a breeze to set up a nice UI in your unity project and everything UI will be more-or-less WYSIWYG, plus manipulating objects in your scene, say a shuffle animation or a bet being placed will be much easier. main drawback is prob you dont get to use React (which i agree is cool and v useful). Wouldn’t say the learning curve for Unity or C# is a hurdle, it’s probably an afternoon or 2 of tutorials for what you need.
I recently started a small personal project with Unity webGL and websocket communication to a node backend. it has a long way to go but setting up a basic UI and communication was actually enjoyable. c# has the observer pattern baked in the language via the Event keyword, you can probably guess that’s pretty useful to subscribe listeners to ws messages and such.
Also check out the browser game curvefever, which is made with unity and uses ws communication as well. nothing too impressive but it does manage smooth gameplay and low latency.
One last note is builds will probably rather large and build times long as there’s a couple of steps (i think using IL2CPP and then to wasm). so a card game can get by with just React, but I wouldn’t call it the right tool for anything that’s a game. With Unity or UE for that matter user input is taken care of, you have a physics engine if you’d need one, you could make 3d games, have spatial audio support… and moving “GameObjects” around in a scene seems less convoluted and easier to grasp than css animation imo.
Anyway, if you or anyone else (grue?) is interested, i can elaborate more or share snippets/even the project to get you started. and again, i have used and loved React. for stuff like this, i love anything using webgl more though
Update on my daughter’s memory-matching game. It turns out it was the end-of-semester AP test. (AP is Advanced Placement, for those of us who went to school in the stone age.) Tests are scored on a 1-5 scale, with 3 generally considered a pass, which means many colleges will allow you to skip the 101-type class in that area. She took three AP classes her Freshman year, and three this year (and I think 3-4 honors classes–basically, every class has been honors or AP, except one, which didn’t offer either).
So anyway, she got a 3 on the CS AP project. It might have hurt her score that she followed instructions and noted in the code that @bobman0330 wrote the loop in the code. Her classmates were sure she’d get a 5 because their programs were so simple in comparison. She was bummed but I told her I wouldn’t want her skipping a CS class in college, anyway, because it’s probably going to be such a foundation for anything she does, and a one-semester class in high school–half of which was done through distance learning–wasn’t enough.
She got 5s on both her World History and Physics tests.
I think graphql has a bunch of front-end/back-end married packages - some even tied to an ORM. To me that’s the real promise of graphql.
If I have to write a bunch of back-end graphql query handling logic basically from scratch it’s not worth it imo. Might as well just do rest. But if I can get front end all the way to the DB in one package, then I feel that makes sense for some sites.