-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Huge performance drawdown since version 1.5.1 #74
Comments
This was probably introduced in 1.5.0. In order to address #65 and #59, I changed Viz.js to create a new Emscripten module instance on every call (somewhat like running the
As well as the overhead of setting up a module instance, there is probably some performance impact from the extra garbage collection involved. And even though I was attempting to prioritize stability over performance for that release, in some situations Viz.js can now cause an out of memory error. See #72. There may be workarounds that allow Viz.js to reuse the module instance:
I'll look at implementing these for a patch release. |
@mdaines I have run the same test agains the much bigger dot file and this definitely doesn't look as an overhead caused by setting up module instances as it relates too much on graph size. For the github graph I attached to the previous issue I get the following numbers: First run:
Second run:
Plunkr is here This time I run generation only once. As you can see difference between 1.4.1 and 1.5.1 is more than 11seconds which doesn't looks like as an overhead of setting up a module and garbage collection. I'm pretty sure this was caused either by switching from I can prepare a performance test as a PR and you then can run it with different options.
I will run tests myself and let you know if any of above is the reason. thanks |
Thanks for checking a larger graph -- I'll try modifying those options to see if there's any improvement and post the results here. |
Here are my results (using Node). It certainly looks like ALLOW_MEMORY_GROWTH slows things down, and that the -Os setting might be slightly faster. I've attached the builds I used below.
|
Thanks for your efforts! It would be great if we can fix this issue. I see the point why you enabled How about bringing back I understand API-wise it is not so good for users to guess memory-size required but we can't come up with a better solution. What do you think? |
My hunch also is that most people don't run into that problem. I could add an option to the
|
@mdaines it would be perfect! |
Hi @mdaines. First, thank you for your hard work!
We work with big graphs and noticed a huge performance drawdown since version 1.5.1.
I have prepared a plunkr in which I measured time to build one of our sample graphs using 3 different versions of
viz.js
:1.4.1
,1.5.1
and1.6.0
. On my machine (MacOS Sierra, Chrome 55) I've got the following results:First run:
Second run:
You can check it yourself here: http://plnkr.co/edit/g4h7F2wfoU3MV1YmiIie?p=preview.
Most likely this was caused by switching from
-O2
to-Os
or by enabling dynamically allocated memoryALLOW_MEMORY_GROWTH=1
(they say that enabling this option disables some optimizations)I didn't manage to install
emscripten
on my machine in a reasonable amount of time so wasn't able to check the exact reason.I have attached a few graphs we work with in
dot
format to this issue.Thank you.
dot.zip
The text was updated successfully, but these errors were encountered: