Reviews 02 Jan 2011 01:37:26

Star Wars: The Force Unleashed

Star Wars: The Force Unleashed for PC from Steam, played with keyboard and mouse.

Looks great, but the controls are awful. Hitting your target with a force thrown object is basically random chance. And switching to 2D mode for boss battles makes them stupidly difficult…suddenly, all that you learned playing in the 3D mode is taken away and you’re put in a platformer, only with even more broken controls; you think you’re about to Force Lightning the boss, and it just fizzles right next to them. And to top it all off, there are quick time events…

This could have been an awesome game if they fixed the controls and removed the QTEs, but as it is the controls ruin the experience.

For a longer review, this guy tells it like it is.

C++ 14 Apr 2010 20:41:21

C++ dynamic_cast Performance

(Updated 2010-10-27: Re-run the test with latest clang++ from subversion)

A performance comparison of the speed of dynamic_cast operations in C++.

Idea from http://www.nerdblog.com/2006/12/how-slow-is-dynamiccast.html, who did not provide any source so I wrote my own more extensive tests.

Sources

Things Tested

  • reinterpret_cast on a known type
  • virtual function call + reinterpret_cast
  • member variable access + reinterpret_cast
  • successful dynamic_cast to its own type
  • successful dynamic_cast from the derived levels to lower levels
  • failed dynamic_cast from the derived levels to an unrelated type


Continue Reading »

C++ 02 Apr 2010 19:11:11

C++ Set Performance

(newer version from 2012-02-20, older std::map benchmarks for GNU g++ 4.3.2 and MSVC++ 2010 beta 2)

A performance comparison of the speed of operations on the various set implementations used in C++. There are 16383 unique elements across which 1000000 insert, lookup, iterate, and erase operations are performed.

And this time I’ve left the raw tick numbers and enabled table sorting so you can compare for yourself. Just be aware that the Linux and Windows numbers cannot be compared against each other.

Sources


Continue Reading »

C &C++ &Code &Java &Perl &PHP &Python 17 Mar 2010 21:13:56

Language Comparison: Find Longest Line

The task: Write a portable tool that takes a file name as first argument, and from that file outputs the number of lines, the longest line, the length of the longest line, and the line number of the longest line, in a binary-safe fashion (meaning, \n is the only reason a line should be delimited; embedded \0s may occur).

My sinister side goal is showing how complex the C code has to be in order to get performance near C++. It is possible to write a simpler version in C that is 20% faster for /usr/share/dict/words, but it is then 4x slower for the random files. It would also be possible to write a faster non-portable version using memory mapping, but can’t really call that simple. C++ has both readability and speed. If I missed some obvious portable optimization in the C code, let me know…

The contestants are:
[table "12" seems to be empty /]


Continue Reading »

C++ 16 Feb 2010 19:58:03

C++ Convert String to Int Speed

(There is also an opposite int-to-string performance test.)

(Updated 2010-04-15: Re-run with g++ 4.4.1 and VC++ 2010 Express; updated tables to show both ticks and relative factor, instead of just percentage of baseline.)

A performance benchmark of which method is faster of converting an std::string to an integer. The goal is ending up with an integer with the value represented in an std::string.

The tested methods are:

  • atoi()
  • atol()
  • strtol()
  • std::stringstream
  • std::stringstream, reusing the object
  • boost::lexical_cast<int>()
  • a hand-written naive loop

Source for the test is at speed-string-to-int.cpp with cycle.h.

The compilers are Microsoft Visual C++ 2010 Express as VC10 with _SECURE_SCL disabled, GNU g++ 4.4.1, and LLVM clang++ from svn.

Continue Reading »

« Previous PageNext Page »