3 ms·
I suspect that many Flash apps have a loop running at a certain frequency, which can have about the same performance impact of polling. Compared to an event-dri
by mkramlich 16y ago
I suspect that many Flash apps have a loop running at a certain frequency, which can have about the same performance impact of polling. Compared to an event-driven architecture, a loop is always running, with each iteration consuming CPU even if there is no real work to do that iteration. I had a brief foray as a Flash programmer and noticed this pattern in some of the codebases I saw, and in what the Flash IDE seems to push. Not sure how widely spread it is, or done any measurements on impact, however. But it has the potential to contribute to the CPU sponging the Flash browser plugin is notorious for. Take this effect, multiple it by many little Flash apps per tab, many tabs, many windows, and it can add up.
- kreek 16y agoWhile it is true that some Flash apps have loop (games must have a loop) it's a bit ignorant to compare it to an event-driven architecture. Flash's ActionScript, which is based on ECMAScript (as is JavaScript), is an event driven-architecture. Events are first class citizens of the framework and bubble up through the display list. Even the loop that gets abused by so many is firing off events.
- mkramlich 16y ago> While it is true that some Flash apps have loop (games must have a loop) it's a bit ignorant to compare it to an event-driven architecture. not sure if you meant it, but that comes off as pretty rude. loops and EDA's are different things, and there is value in comparing and considering them. also, the Flash API's may have first-class support for the notion of events, but that does not mean that every glorified loop involves events, or vice versa. in a pure EDA, no task is performed unless an event of interest occurs. mindless polling and housekeeping loops are one anti-pattern contributing to unnecessary CPU use. also, while we're being pedantic, technically not all games require loops. I've built plenty myself that had no loops in the application code.