Giter VIP home page Giter VIP logo

Comments (17)

gero3 avatar gero3 commented on May 3, 2024

Here is already something I was working on:
http://jsperf.com/threejs-canvasrenderer-improvements

from three.js.

mrdoob avatar mrdoob commented on May 3, 2024

Looks good!

Does it win a lot to have the empty in the same method? I mean, maybe just add3Points()/add4Points()?

I don't think core classes are going to change any time soon. I think the API is starting to get quite stable. We change from time to time materials related stuff, but the rest I think it's quite stable.

from three.js.

gero3 avatar gero3 commented on May 3, 2024

`changed it

from three.js.

mrdoob avatar mrdoob commented on May 3, 2024

Uh, I see... :)

from three.js.

gero3 avatar gero3 commented on May 3, 2024

I updated the add3points algoritm to use ternary operators and now It only uses half the time in both ie9 and chrome 10. I didn't test in firefox opera or safari.

http://jsperf.com/threejs-canvasrenderer-improvements/2

from three.js.

 avatar commented on May 3, 2024

Same results here. 60% faster on Chromium 8 and Firefox 4b7. Great! :)

from three.js.

mrdoob avatar mrdoob commented on May 3, 2024

I've implemented the optimisations gero3. It's hard to notice the improvements becase the bottleneck it's the context API, but everything seems correct :)

from three.js.

gero3 avatar gero3 commented on May 3, 2024

I know but those where the bottlenecks without the context API

from three.js.

mrdoob avatar mrdoob commented on May 3, 2024

Yeah for sure. Thanks!
Now we just need the browsers to accelerate context...

from three.js.

gero3 avatar gero3 commented on May 3, 2024

Actually the profiler in google chrome 10 seems to say they already have in the new chrome build because the bottlenecks seems to be around the render function and the projectscene function

from three.js.

gero3 avatar gero3 commented on May 3, 2024

Also the use of instanceof seems to be an overhead

http://jsperf.com/test-instanceof/2

from three.js.

 avatar commented on May 3, 2024

typetest is 65% faster in my case (Chromium 8 / Ubuntu)

from three.js.

mrdoob avatar mrdoob commented on May 3, 2024

Interesting... but, although I'm not sure we're using this still, we lose all the prototype chain - instanceof checks for the object and the objects it extends.

gero3: Do you think all these optimisations will still be valid when stuff like crankshaft lands?

from three.js.

gero3 avatar gero3 commented on May 3, 2024

I think they will as I tested these optimizations already in Google chrome 10 which has already the crankshaft engine. Also the crankshaft does the same optimizations as the TraceMonkey, only on a different way which already is in FF4 for a longer time.

from three.js.

gero3 avatar gero3 commented on May 3, 2024

I don't think you use any of these anymore but it is indeed a problem if persons want to add their own material or rendererable by extending the working solution

from three.js.

Dandandan avatar Dandandan commented on May 3, 2024

The two functions that together use the most cpu are now:
29.95%
setupMatrices
22.40%
renderBuffer

(of 41% spend in total).

from three.js.

gero3 avatar gero3 commented on May 3, 2024

Okay I'll look into to improve them

from three.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.