SummerOfCodeProposal Ryanc

From The Battle for Wesnoth Wiki
Revision as of 09:07, 2 April 2009 by Ryanc (talk | contribs) (Introduction)

Optimize implementation of WML for memory usage

Details

Name: Ryan Chew

Age: 24

Email: ryan@chewablestudios.com

Forum ID: chewryan

IRC ID: KnightR

Detailed Application: Link Here

Introduction

Greetings and welcome to my humble wiki abode.

My name is Ryan and I'm currently enrolled at DigiPen Institute of Technology - Singapore, earning a BSc in Real-Time Interactive Simulations course.

Project

Estimated Timeline

May

  • Get a better feel of how the Wesnoth developers work.
  • Study WML's technical implementation (learn how documents are parsed).
  • Profile WML's memory usage and identify areas which are taking up large amounts of memory.
  • Research on various implementations to reduce memory usage.
  • Run ideas through developers and community for optimal solutions and refine them.

June

  • Implement initial solutions and test, test, test.
  • Research other possible areas of improvement.

July

  • Research stops and working time should all be spent on continued implementation of discussed and agreed-upon solutions (no more new stuff).
  • Prepare for mid-term evaluation.

August

  • Testing and bug fixing
  • Wrap up for final evaluation.

Technical Details Currently, one of the major memory hogs is the use of std::map and the large amounts of strings stored by the config class. The idea would be to find an efficient implementation to replace the usage of a map, reduce string duplicates and, if needed, revert to simpler data structures. Here are several ideas for implementation:

  • Use a simple hash (with caching and fast reverse-hashing features) as the key instead of std::string.
  • Store values in their integral forms instead of std::string.
  • Find a viable replacement for std::map, like an ordered vector which indexes into values.

Time would also have to be allocated to study WML's technical implementation and possibly detail it in a technical document as I understand the documentation is lacking at the moment. There will probably be other areas for improvement as well, like lazy-loading, but those will have to wait until I fully understand the inner-workings of WML.

Expectations

Working on an OSS project for the first time, I expect to gain valuable industry skills/knowledge and to learn from the experienced developers currently on the Wesnoth project. This experience will also provide me a chance to work in a highly diversified team and learn to manage working with developers in different locations and timezones.

Wesnoth is a fun little game that I can see myself dedicating time and energy to developing even after GSoC is concluded. Plus, I wouldn't pass up on the chance to continue learning from the Wesnoth developers and expand my programming knowledge :)