Comments (14)
I've never even attempted to optimize it. I'll work on it.
from atc.
Good job. I've tried profiling a little, but wasn't nearly proficient enough with the architecture to see an obivous fix. canvas_update_post()
came up.
from atc.
That's where the entire radar view is drawn. There's no view culling yet. The current bottleneck is drawing the text for each airplane; if I have to, I'll move the text drawing to the DOM, but that's a pretty major change.
from atc.
I've vastly reduced redrawing in version 2.1.4; could you test again?
from atc.
@joallard What year is your MBA? I'm also playing on an Air and didn't notice any performance-related issues in the prior versions.
from atc.
2.1.4: CPU seems to have more breathing space. I think the regular speed has gotten slower though. Might be unrelated.
@jvt Late 2013.
from atc.
@joallard, aircraft speed shouldn't change; I just redraw the canvas once every 20 frames or so. They might jump visibly when on higher speed settings, though.
from atc.
It may very well just be my perception, caveat emptor, but it feels to me a little more jittery and slowish.
from atc.
A significant portion of the time to draw each aircraft - 60-80% using console.time()
- is drawing the trailing position dots, not drawing the aircraft itself. This is because canvas_draw_aircraft()
saves and restores context and recreates a custom fillStyle
and a filled arc - for every single trailing dot for every visible aircraft. This is very slow. I will send a pull request with an idea for a faster method which is visually similar.
from atc.
The first picture is the existing aircraft trail, the second is a test of a much faster method (rectangles and fixed opacity).
from atc.
And here is a picture of the fast method with variable opacity. Which is the best?
(EDIT: This can be drawn in 1/5 of the time compared to the current method)
from atc.
@glangford Nice. This last render looks really good!
from atc.
@joallard , @zlsa - With changes #131, #141, #149, #150 I can run now for an extended period without excessive heating or fan use (older Macbook Pro). If there are no objections, I propose this issue can be closed.
from atc.
I'm clocking in at 1.5% CPU usage. Good job.
from atc.
Related Issues (20)
- Aircraft do not always reach target altitudes HOT 1
- Refusal to takeoff HOT 24
- Questions HOT 12
- Game crashes after issuing "Hold" command HOT 2
- Airport ZSPD has two runways called 34R HOT 1
- Guiding aircraft via multiple waypoints HOT 2
- Reroute command countermands altitude command HOT 4
- Mega-precision in aircraft strips.. HOT 2
- Game Hangs after 5 mins for Changi Airport (WSSS) HOT 6
- assigned altitude read backs are erroneous. Assign an altitude of 4,000, a/c reads back 10,000. Descend to 1,500, a/c reads back 4,000. HOT 2
- South Africa HOT 2
- Please add the airport of Santo Domingo Dominican Republic las Americas Int. MDSD HOT 1
- help With aircraft delivery HOT 2
- Please add the Denver International Airport KDEN HOT 1
- Please add military aircraft / flights to the game
- Please add military aircraft / flights to the game
- Please add enroute aircraft / overflights to the game
- Please add Vfr aircraft / flights to the game
- Please add he
- Please add helicopter aircraft / flights to the game
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atc.