Git Product home page Git Product logo

Comments (2)

gvissers avatar gvissers commented on September 28, 2024

LOL. I had some fun making a start on this. Check my dexml branch (https://github.com/gvissers/Eternal-Lands/tree/dexml) if you want to play.

Anyway, I thought I'd try to start by converting the XML to C code, which is then compiled into the executable directly. It saves the hassle of having to write import functions, and since we're dealing with text files it is much easier to debug. Optimistically I started with the actor definitions. Well, nearly two weeks and 200,000 lines of generated code later, I'm happy to say that the process worked. Of course the default (debug) build ballooned from 3.2M to 21M, and the overall speedup of the boot process is questionable, but it works.

So here's some numbers, five runs, all wall clock time. The time spent in init_actor_defs is indeed nearly halved.The variances in the overall boot time are much greater than any potential savings though. (well, I did only test it on my latop, which is reasonably fast and has an SSD. YMMV).

Actor defs parsed at runtime, default build:
Size of executable: 3.2M
init_actor_defs: 0.358 0.356 0.358 0.355 0.351
init_stuff: 1.687 1.211 1.613 1.656 1.255
avg init_actor_defs: 0.36s

Actor defs compiled in, default build
Size of executable: 21M
init_actor_defs: 0.165 0.166 0.181 0.207 0.177
init_stuff: 1.422 1.679 0.953 1.023 1.435
avg init_actor_defs: 0.18s

Actor defs parsed at runtime, release build:
Size of executable: 2.9M
init_actor_defs: 0.324 0.374 0.336 0.320 0.322
init_stuff: 1.414 1.026 1.005 1.161 1.115
avg init_actor_defs: 0.34s

Actor defs compiled in, release build
Size of executable: 7.9M
init_actor_defs: 0.151 0.140 0.160 0.153 0.144
init_stuff: 1.172 0.720 0.825 0.758 0.742
avg init_actor_defs: 0.15s

Anyway, now that I've hashed out how to store the data, I can more easily come up with a binary file format. For the encyclopedia we probably want to do this anyway, since I've just realized that that's 14M of XML data (as opposed to just 600K for the actor defs, though the latter includes a lot of its files multiple times for different actor types).

from eternal-lands.

raduprv avatar raduprv commented on September 28, 2024

from eternal-lands.

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.