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

save array creations on each raycaster update #3317

Merged
merged 1 commit into from
Dec 25, 2017

Conversation

ngokevin
Copy link
Member

@ngokevin ngokevin commented Dec 20, 2017

Description:

flattenChildrenShallow was creating two arrays on each raycaster refresh. And raycasters auto refresh every time there is an attribute change or child append on the scene. And a scene has often multiple raycasters. So this saves quite a ton of arrays.

Changes proposed:

  • Reuse arrays for raycaster flattenChildrenShallow.

@@ -38,7 +38,7 @@ module.exports.Component = registerComponent('raycaster', {
direction: {type: 'vec3', default: {x: 0, y: 0, z: -1}},
enabled: {default: true},
far: {default: 1000},
interval: {default: 0},
interval: {default: 100},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you meant to revert this change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do in another commit, i think 100 was appropriate for perf

@dmarcos dmarcos merged commit cfe3566 into aframevr:master Dec 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants