Comments (6)
A few initial impressions on this:
- The rendering code takes a trivial amount of time (a few ms per frame) - almost all of the time is spent on writing the rendered canvas to disk.
- There's no real difference between a
pngStream
and using synchronous.toBuffer()
in terms of performance. - Using an asynchronous
.toBuffer()
is about 4x faster, but means that we can't render in parallel on the same canvas. This is probably fine - Adding compression as a second argument would probably speed it up some more.
One possibility is to create a new Canvas
for every frame, rather than a shared one. This would speed up the I/O a lot, but add some overhead for that. The smarter option would probably work is to create a pool of n
canvases, where n
is the max concurrency, and share them that way.
from audiogram.
Tried this with a pool of canvases and async toBuffer()
and rendering time is about 4x lower than previously. Will have to test this elsewhere, it may run into memory issues. May also involve refactoring the renderer/
code a bit.
from audiogram.
Have a seemingly-working version of this on the refactor
branch.
from audiogram.
No apparent memory issues, but the performance benefits seem to be contingent on having multiple cores.
from audiogram.
Per the above, might want to set the parallelism based on the value of os.cpus()
, though it's not clear whether it would hurt anything.
from audiogram.
Merged this to master
. Should see performance improvements on a multicore machine.
from audiogram.
Related Issues (20)
- Testing audiogram under codedeploy
- Stuck on "Probing Audio File" HOT 1
- Install failed at the [email protected] install script HOT 2
- maxDuration HOT 2
- Redis "Waiting for other jobs to finish" but there are no other jobs. HOT 1
- Stuck at Generating Frames, 0% complete
- Fixed issue with install, now stuck in queue HOT 1
- Process multiple videos at the same time
- Video resolution
- Unable to install canvas 1.6.0 in node 10.15.0 HOT 6
- Need Logo Icon?
- Stereo/Multichannel support
- Successful installation via Docker...then nothing HOT 3
- Application Hangs
- FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
- I wonder if there is an maintained version of Audiogram HOT 1
- Generating longer audiograms error
- Docker Build Error HOT 5
- Why is there a MaxDuration property needed?
- Installation fails - any ideas?
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 audiogram.