-
Notifications
You must be signed in to change notification settings - Fork 92
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
bundle size #1
Comments
box-intersect is hard to kill. Buffer is probably an accident and shouldn't be there. The tough one is bn.js, which might be removable with some work. What we really need is a modular bignumber. Perhaps this could be part of rat-nest? |
The size isn't a huge deal, but might turn some people off using it for frontend purposes. Buffer is from typedarray-pool I think. Maybe also some other modules are using it? |
p.s. How do you usually go about unit testing triangulation modules? |
Well, cdt2d and the other pslg type modules are a bit rough right now. I wrote that whole suite of modules in one shot during an 18 hour plane ride to Dublin, and I haven't revisited them in more detail yet. The most important thing with geometry programming is to get the basics 100% first before jumping into more complicated stuff. For anything like triangulation, you should not be using raw inexact floating point arithmetic, unless you are ready to bear the pain later on. Using correct and robust predicates means that you can be very certain that you've caught all the logic bugs in a higher level routine using more basic unit testing practices like code coverage and fuzzing. For writing test cases, I try to look for degeneracies and test those first. These are usually things like denormal numbers, overflows, rounding bugs, or input which is not in general position. So things which are usually good test for triangulation specifically are:
It is also important to test the performance of a module too. It is very easy in JavaScript to write code that works, but might not have good asymptotic performance due to stupid things like array splicing or string copying. So you usually need to run some experiments with inputs over a parameter sweep and then test that. |
The bundle size is fairly large (101kb).
Biggest dependencies:
Taking a look in
disc
, some heavy hitters arebox-intersect
,bn.js
, and of coursebuffer
./cc @mikolalysenko - what do you think?
The text was updated successfully, but these errors were encountered: