Giter VIP home page Giter VIP logo

Comments (10)

flashultra avatar flashultra commented on May 30, 2024

It's possible to be something eval target specific. On try.haxe ( js target ) is about 0.12 sec.
https://try.haxe.org/#0c7a7 , same on try-mrcdk ( http://try-haxe.mrcdk.com/#e6074 ) with latest haxe dev

from crypto.

Simn avatar Simn commented on May 30, 2024

Can you factor out some code that executes slowly so I can take a look?

from crypto.

flashultra avatar flashultra commented on May 30, 2024

Sorry, maybe is not so clean code, but here is example: https://try.haxe.org/#ed87F
The problem is with function f(x:Int)
On eval I get :
Time: 5.0531008243560791 seconds
For JS :
Time: 0.6010000705718994 seconds

from crypto.

Simn avatar Simn commented on May 30, 2024

Well, we have to put things in perspective here:

target time
python 51.3
hlinterp 29.7
flash 12.4
php 11.4
neko 5.2
eval 4.9

Of course a number cruncher like this is going to be slow on targets that don't have a static compilation or a crazy JIT like JS does.

from crypto.

Simn avatar Simn commented on May 30, 2024

You can bring this down to 3.7 by making f and sBox static. Eval has trouble optimizing instance calls because it can't be sure if a function is overridden or not. Technically, I can't even rely on final for that because there's this goddamn @:hack thing.

from crypto.

hughsando avatar hughsando commented on May 30, 2024

from crypto.

Simn avatar Simn commented on May 30, 2024

Sure, but then there's no call left for me to optimize.

From Nicolas reaction, it seemed like we don't have to consider @:hack. We might want to restrict it to externs.

from crypto.

hughsando avatar hughsando commented on May 30, 2024

Yes, it would be sad not being allowed to optimize anything.

from crypto.

Simn avatar Simn commented on May 30, 2024

I just checked, @:hack only works on classes, not on fields. So checking cf_final is safe, we just can't check for cl_final until we address HaxeFoundation/haxe#7473.

from crypto.

flashultra avatar flashultra commented on May 30, 2024

Using Vector give some performance boost . Nothing else can do here .

from crypto.

Related Issues (17)

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.