objeck / objeck-lang

Objeck is a modern object-oriented programming language with functional features tailored for machine learning. It emphasizes expression, simplicity, portability, and scalability. The programming environment consists of a compiler, virtual machine, REPL shell, and command line debugger with IDE plugins.
https://objeck.org
Other
154 stars 11 forks source link

The Objeck VM eats more RAM but the performance of JsonParser is still terrible #430

Closed ghost closed 9 months ago

ghost commented 9 months ago
          > Yes, it is fixed. I will close the issue.

The Objeck VM eats more RAM but the performance is still terrible. I'm very disappointed.

Download Adept here: https://github.com/AdeptLanguage/Adept/releases/tag/Nightly

Compile the code with adept test.adept:

pragma compiler_version '2.8'

import basics
import JSON

func main {
    json JSON = JSONFromFile("Web.MsHtml.json")

    if json.kind() == ::UNDEFINED {
        print("Failed to load json")
    } else {
        Constants <JSON> List = json.field("Constants").array().get()
        Constant0 JSON = Constants.get(0)
        print(Constant0.field("Name").string().get())
    }
}

You will see how fast it is compared to your parser.

Originally posted by @yyokyfo in https://github.com/objeck/objeck-lang/issues/407#issuecomment-1859281146

objeck commented 9 months ago

Feel free to optimize the JSON parser as it is written in Objeck.

https://github.com/objeck/objeck-lang/blob/master/core/compiler/lib_src/json.obs

ghost commented 8 months ago

Feel free to optimize the JSON parser as it is written in Objeck.

https://github.com/objeck/objeck-lang/blob/master/core/compiler/lib_src/json.obs

As an end user, you know that it's impossible for me to do that. If I can, why don't I implement my own JSON parser? You should know that I was really disappointed. Why did I disappointed? Because I believed too much in you and the Objeck language. I did expect too much. This is no longer the case. I'm sorry for my not very polished words in the past. But please don't talk with me like that. It really hurts my feelings.

objeck commented 8 months ago

Feel free to optimize the JSON parser as it is written in Objeck. https://github.com/objeck/objeck-lang/blob/master/core/compiler/lib_src/json.obs

As an end user, you know that it's impossible for me to do that. If I can, why don't I implement my own JSON parser? You should know that I was really disappointed. Why did I disappointed? Because I believed too much in you and the Objeck language. I did expect too much. This is no longer the case. I'm sorry for my not very polished words in the past. But please don't talk with me like that. It really hurts my feelings.

My apologies. I will look into JSON behavior over the weekend.