Skip to content
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

Performance difference with the native C++ environment. #1077

Open
alalialisiong opened this issue Dec 17, 2021 · 1 comment
Open

Performance difference with the native C++ environment. #1077

alalialisiong opened this issue Dec 17, 2021 · 1 comment

Comments

@alalialisiong
Copy link

Hi. I'm using the CGAL library in a similar way to yours.
My project was built by referring to your emcc build command and cgal.cc .
However, there are too many differences when comparing the performance in native c++ environment and wasm environment.
For example, I experimented with a simple example from the surface_mesh_simplification package in the CGAL library. When tested using the same model and options, the following results were obtained.
native c++ => 0.085 sec
wasm => 4.977 sec
May I ask if you find the same phenomenon?

@pentacular
Copy link
Member

Sorry for the late reply -- I missed the notification.

I would expect it to be significantly slower for a couple of reasons.

(a) CGAL depends on exception handling within its numeric models, and this is slow in WASM at the moment.
(b) Using GMP based numbers can get expensive for fractions with large numerators and denominators.

There isn't much that you can do about (a), but if you don't require precise construction, you may find that an Epick kernel speeds things up significantly.

Mostly I deal with speed issues via aggressive caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants