Speed opt.

Jump to navigation Jump to search

Speed opt.

Hey, since you are probably diving deep into optimizing a robot, if during the process you happen to benchmark the tweaks you are doing, can you post your results here? I find it beautiful those bots which are strong and fast like Shadow and Ascendant, and although I really feel like doing this someday, I happen to postpone it because Im not sure it is worth it in terms of sacrificing code legibility and effort for a very little speed increase.

Rsalesc (talk)21:29, 1 November 2017

Well, benchmarks are a good thing, since you’ll know the effectiveness of each step, and make sure your optimization is actually optimization, rather than something that does good theoretically but slows the entire program down for some reason. Maybe I’ll do a benchmark comparing Scalar with ScalarBot, after the migration is done. Since the code of Scalar is written to be optimized (and optimization is part of the initial design), it’ll be a lot of work for me to compare it with the most natural way to human of doing things ;)

Anyway, since the optimization is already part of the initial design, I don’t think it sacrificed the legibility in any sense — actually with some interface carefully designed, you’ll feel that even easier to use/read than some traditional way of Java.

E.g. the pre-allocation of objects is mostly done by the custom container, I just use it normally as it were ArrayList. I may post some util here later for everyone to have a try and see the difference to speed ;)

Xor (talk)04:02, 2 November 2017

Yeah, sacrificing code legibility was my excuse before seeing that pooling seems to be a nice workaround. Now my excuse is simply the effort it takes :P

Rsalesc (talk)04:20, 2 November 2017