Comments (10)
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.
Can you factor out some code that executes slowly so I can take a look?
from crypto.
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.
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.
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.
from crypto.
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.
Yes, it would be sad not being allowed to optimize anything.
from crypto.
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.
Using Vector give some performance boost . Nothing else can do here .
from crypto.
Related Issues (17)
- Travis : Type not found : haxe.crypto.Aes HOT 3
- Does it support Aes-256 bit HOT 2
- Incorrect result for AES CTR 128 Bit HOT 7
- Error "haxe.io.Bytes should be String" HOT 3
- SHA-256 is wrong on PHP (new Haxelib release needed) HOT 8
- Haxelib says latest version is 1.0.2-alpha, but 0.4.0 was published more recently? HOT 2
- Need PKCS5 Padding HOT 6
- Haxe-crypto HOT 9
- [Neko specific issue] Uncaught exception - load.c(398) : Invalid module : main.n HOT 4
- PHP test failures HOT 2
- Sha256 Unicode test failed HOT 7
- [eval] Ripemd-160 test failed on Appveyor HOT 2
- Compatibility for Haxe 3 HOT 5
- [feature request] rsa support HOT 4
- Publish on haxelib HOT 2
- Use Vector instead of Array HOT 2
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 crypto.