Comments (3)
Hi ahmadsholehin,
I've moved the math code from three
into math-ds
to reduce the bundle size for projects that don't use three
.
The real problem lies with the tree-shaking implementation of popular bundlers. Unfortunately, all of them are rather conservative in that aspect and don't actually remove a lot of unused code. If tree-shaking worked flawlessly, depending on three
would be an option. But even then, the math code from three
should reside in a separate module to speed up the bundling process. Code analysis takes a while and three
is big.
The sparse-octree
library only uses Box3
, Ray
and Vector3
from math-ds
and yet all the other unrelated classes get included in the final bundle for no reason. That's still much less unused code compared to using three
as a dependency in projects that don't use three
. When I created sparse-octree
for one of my projects, it did rely on the math classes from three
. But then my bundles all included a stupid amount of unused classes from three
. The compromise was to use a dedicated math module.
I'm keeping an eye on the bundling output, but nothing has changed in the past years.
from sparse-octree.
I'm keeping an eye on the bundling output, but nothing has changed in the past years.
After looking into the build setup again, I found out that rollup-plugin-babel
is breaking the tree-shaking. I've changed the setup in 9f1d286 and now the unrelated classes are gone from the final bundle.
So if your build setup is configured correcty, the actual footprint of the math-ds
dependency will be very small.
from sparse-octree.
Closing due to inactivity.
from sparse-octree.
Related Issues (17)
- Add raycasting unit tests.
- Improve duplicate check. HOT 1
- Precompute the octant center. HOT 1
- .fetch() errors for empty PointOctrees and leaf octants in a sufficiently large Octree HOT 2
- Bug in findNearestPoint function HOT 3
- Node insertion efficiency HOT 2
- Help with how to use? HOT 4
- Duplicate points HOT 3
- Browser support? HOT 2
- I cant create point in same position HOT 3
- Improve testPoints in Raycasting. HOT 1
- PointOctree with 8 or fewer points fails to retrieve leaves HOT 6
- `raycastOctant` being passed Tree instead of Node HOT 1
- Setting a point a second time in PointOctree sets data to the wrong index HOT 1
- Wrong typescript definitions HOT 1
- Reduce object creation during raycasting.
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 sparse-octree.