Phase 2 ends

The phase 2 comes to an end, finally. It has lasted the same as the summer, from the beginning of May to the end of October (yes, that's the duration of the summer here at the Costa del Sol). Six months of hard work which I’m proud of, although not all goals were reached; so many things learnt, a lot of challenges completed and more steps taken to the construction of a solid, independent and useful infrastructure for the engine. As said many times in previous posts our resources are minute, but a bit of sacrifice is enough to keep pushing forward.

Before exposing some statistics about the project and a summary of the main development milestones, I would like to remark that every component in the code repository (rev. 1398) is ready-to-use; everything is documented and fully tested, and compiles on any of the supported OS (Windows, Linux or Mac). Nevertheless, no effort has been spent on optimization yet; some features may be already optimized and some others may not that much. Examples of this are the containers: they are not currently as fast as STL containers but some experiments revealed that they can be easily improved to be slightly faster than them; this improvement might be included in the next development phase, as it is so cheap to do (just storing a pointer). The same happens to the Math library, which does not make use of SIMD yet despite it’s so simple to include such instructions in the existing code; it is just not a priority at the moment. In closing, just an obvious warning: the public interface of the entire library is prone to change until the first version of the engine is officially published, so please have this in mind if you decide to include it in your projects.

The big picture

Let’s go with some numbers about the current state of the project:

  • 239.092* lines of code, without blank lines or file header comments, counting test code.
  • 68.800* lines of code, without blank lines or file header comments, not counting test code.
  • 350* code files, counting test code files.
  • 208* code files, not counting test code files.
  • 143* classes.
  • 43%* of the lines of code (without tests) are internal or public documentation.
  • More than 7.100 unit tests in total, 1.600 of them written during this phase.
  • 116 revisions in Subversion during this phase (code is committed only when a task is completely done, including unit tests, and after it has passed the review).
  • 73 tasks completed during this phase.
  • More than 450 tasks finished so far in total, from 600 created in the tracker.

*These numbers were obtained by using the Source Monitor tool.

By taking a look to this data, one can get an idea of the importance we give to both testing (three times more test code than tested code) and documentation (43% of the lines of code). If we add these efforts to our concern with usability (which cannot be measured, unfortunately), the result is that the development of new features is slow, but it is worth really. In the end, not spending time to fix serious bugs or having to explain to users, one by one, how things work is a good future investment.

 

Summary of the work done

New classes

  • Containers: QNTree, QDynamicArray, QBinarySearchTree.
  • Iterators: QListIterator, QNTreeIterator, QBinarySearchTreeIterator, QConstArrayIterator, QConstListIterator, QConstNTreeIterator, QConstBinarySearchTreeIterator.
  • System time and date: QDateTimeNow, QLocalTimeZone.
  • Timing: QStopWatch.
  • File system: QPath, QFileInfo, QDirectoryInfo.
  • IO: QMemoryStream, QBinaryStreamReader.
  • Data types: SQTypeExtensions, SQAnyTypeToStringConverter.
  • Logging: SQInternalLogger.
  • Memory allocation: QLinearAllocator.
  • Others: QDelegate, QUri.

Completed pending development and feature extension

  • Containers: QFixedArray, QList.
  • Iterators: QArrayIterator.
  • Date and time: QDateTime, QTimespan.
  • Data types: QStringUnicode, SQInteger.
  • Memory allocation: QPoolAllocator.

Improvements

  • Assertions are now logged, including information about the line number and the file name. They have been also divided in three categories: errors, warnings and deprecations. Besides, they work with Unicode strings through QStringUnicode.
  • Some basic logging utilities that allow sending text from Common and Tools layers, which do not count with logging features (logging classes will be defined in System layer), to any external logging function. Currently, a static member function which sends the text to the active debug console is used by default.
  • Global new and delete operators have been overridden. Now any allocation can be traced.
  • Migration from Code::Blocks 13.12 to CodeLite 6.0.1. The main reason was the poor support of the C::B IDE on Mac OS. Besides, the Clang compiler (version 3.4) along with LLDB were used on Mac instead of GCC + GDB due to many installation problems and bugs (of GDB, mainly). All is much simpler this way and performs better.

 

Pending work

Classes

  • Threading: QThread, QMutex, QSharedMutex, QRecursiveMutex, QScopedExclusiveLock, QScopedSharedLock, QConditionVariable, QScopedLockPair.
  • Call stack tracing: QCallTrace, QCallStackTrace, QCallStackTracePlainTextFormatter, QCallStackTraceConsolePrinter, QCallStackTracer, QScopedCallTraceNotifier.
  • File system: QFile, QDirectory.
  • IO: QTextStreamReader, QBinaryStreamWriter, QTextStreamWriter, QFileStream.
  • Timing: QStopwatchEnclosed.
  • Others: QEvent, QAssertException.

General code improvements

  • Mechanism to enable/disable assertions by their type (error, warning or deprecation).
  • Mechanism to auto-detect the machine’s endianness.
  • Memory allocation tracing.
  • Adapting the code due to some changes in the naming conventions.
  • Performing some text replacements and adding other small features to some classes.

 

It’s time to update the project’s documentation, the road map and the class diagrams. The phase 3 will be planned during this month so it is likely to start on December.

Congratulations to the people who participated during this phase.

 

 

You have no rights to post comments

Twitter