4 ms·
I'm completely fascinated that games can perform massive amounts of math and render 120 frames per second, while some business applications fail to do completel
by mrweasel 9y ago
I'm completely fascinated that games can perform massive amounts of math and render 120 frames per second, while some business applications fail to do completely basic data manipulation in an reasonable time frame.
- test1235 9y agoI think it comes down to requirements. If games aren't running smoothly, people simply won't play them. Business apps have it a lot easier - the users are more forgiving, I guess either because they don't have a choice in the matter or any better options.
- bobthedino 9y agoAlso the people who buy business apps are often not the people who actually have to use them every day. So UI/UX ends up being a much lower priority than say cost.
- hyperpallium 9y agoAnd, if the program processes data too quicky, users think it isn't working. (Managers, perhaps, think it isn't working hard enough.)
- tekromancr 9y agoFortunately, there is a rails library for that. https://github.com/airblade/acts_as_enterprisey https://github.com/airblade/acts_as_enterprisey
- Rusky 9y agoIf that were the problem, we would solve it by adding sleep() calls...
- hacker_9 9y agoDifferent hardware setup - that business might have a database that is dealing with millions of other users at the same time too. In which case they need to invest more in their infrastructure.
- maccard 9y agoIt's not always though. Lots of businesses _aren't_ dealing with millions of other users, they're dealing with a handful at a time, and still manage to be painfully slow. Our Jira instance in work is laughably slow despite being hosted on-site on bare metal and used by 20 people (usually not concurrently).
- erinaceousjones 9y agoOur Jira instance is shared across multiple academic institutions and is hosting hundreds of active projects and I still find page loads to be pretty much instant, so mileage varies I guess! (Not to negate your point though. The crappy HR systems are painfully slow and incredibly frustrating to use, in comparison)
- lou1306 9y agoThese applications may contain bad code, but on the other hand game engines exploit hardware acceleration, so it's kind of an unfair comparison.
- maccard 9y agoJavascript can use WebGL to leverage hardware acceleration, but GPU acceleration doesn't suit all workloads.
- bluedino 9y agoAlmost anyone can program a CRUD app. Very few people can write a game engine.
- tzahola 9y agoThe learning curve of game development is much steeper, especially if you want to create your own engine. When programming with APIs like OpenGL or DirectX, you either know what you're doing and get everything right, or you get a completely black framebuffer and maybe some error codes. There's practically no in-between. For business applications you can get pretty convincing results just by throwing together some buttons and textboxes in NetBeans or Visual Studio.
- jayd16 9y agoData IO and actually having to be correct is why business logic is so slow. Sure, there's megabytes of textures but its already uploaded to fast ram on heavily pipelined and massively parallel device. If you had to look up CRUD vertex and texture data as database rows from another machine through the internet you wouldn't see a very smooth game.
- vvanders 9y agoData flow, data flow, data flow. It's all about structuring your data such that don't don't cache miss on your fetches and you don't stall your pipelines by doing operations that flush/occupy the same pipe. You can easily see 10-50x performance boosts on the same dataset with the right approach. Look up Data Oriented Design, Mike Acton talks about it a ton.
- Asooka 9y agoTo expand slightly, a single read from memory that's not cached and actually has to go to RAM can take 100 cycles. That's 100 cycles during which your CPU does nothing but wait for electrical signals to travel to and from RAM. Well written data processing programs (game engines, physics simulations &c) strive to structure their data so they have as few of those as possible. If you just read "Design Patterns" and wrote a beautiful 10-level deep class hierarchy in Java, where every object access can be behind something like 3 levels of indirection via pointers. This is not a critique against either Design Patterns or Java, both of them are important and useful. And really, quite often you don't care about waiting 100 cycles, you have ten million times 100 cycles in every second. It's when you start crunching numbers in large quantities that it can get problematic. Modern CPUs are very fast, but only if you feed them data in the right order. Otherwise you're basically running on a machine from 20 years ago, just with 32GB of RAM. Best program design right now is to yes, do write your deep class hierarchies and whatnot, but also know how to identify the parts of your program doing heavy computation and how to restructure those so you can unleash the full power of a modern processor.
- SomeHacker44 9y agoTo clarify: "That's 100 cycles during which your CPU does nothing but wait..." is true only in the absolute worst case. In the likely case, your superscalar, out-of-order processor is working on the next several instructions, possibly including some speculative instructions after branches, and simultaneous-multithreading is letting another thread use the now-idle resources. Furthermore, since it's superscalar there are tons of compute resources (integer ALUs, FP ALUs, vector ALUs, to mention a few) which the CPU scheduler will try to keep busy as close to 100% of the time as possible. That said, in any performance critical application, you pay close attention to your memory hierarchy and you design and compile your application in a way to respect that as well as take advantage of the underlying hardware architecture and resources to the fullest.