Giter Site home page Giter Site logo

Comments (3)

killme2008 avatar killme2008 commented on September 13, 2024 2

启用 cache 模式

sum += (Long) AviatorEvaluator.execute("a+b*c", env, true);

1万次只要 110 毫秒左右。

from aviatorscript.

killme2008 avatar killme2008 commented on September 13, 2024 1

你怎么测试的。。怎么可能

    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        Map<String, Object> env = new HashMap<String, Object>();
        env.put("a", 100);
        env.put("b", 101);
        env.put("c", 102);
        long sum = 0;
        for (int i = 0; i < 10000; i++)
            sum += (Long) AviatorEvaluator.execute("a+b*c", env);
        long end = System.currentTimeMillis();
        System.out.println((end - start) + "ms.");
        System.out.println(sum);
    }

1 万次调用 2.5 秒左右,平均 2.5 毫秒。

from aviatorscript.

lfkdsk avatar lfkdsk commented on September 13, 2024

Hi @killme2008 ~
1 million 110 ms efficiency does perform well, but I noticed that the default situation is using Eval mode, the general Eval model on the efficiency of this short expression should have a greater room for improvement.
I tried to implement an expression engine that supports compilation and interpretation of execution. Trying to use meta-cyclic explanations in the explanation to directly evaluate the performance of Ast's current performance.
image
I think aviator can also try to optimize the AST / eval mode to make it better.
Thank you.

from aviatorscript.

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.