def change_text_settings(self, text_settings):
        """Change text settings and replace surface.

        Only does so if the given text settings are
        different than the ones in use.

        Profiling note
        ==============

        I measured the speed of this method both with and
        without the "if block" in a context where the text
        settings were constantly changed between different
        settings. We did so by decorating this method with
        appcommon.debug.measure_average_speed function. We
        used 4, 100, 1000, and 10000 repetitions.

        It turned out, unexpectedly so, that the solution
        with the "if block" made the method quicker when
        the number of repetitions where 4, 100, 1000. The
        speed was about 10% faster.

        We expected all experiments to yield results
        favorable to the solution without the "if block",
        since we know every time the "if check" was
        performed, it came out negative and ended up
        executing the rest of the method anyway, so it
        was just an unnecessary step.

        Only when the repetitions were 10000 the solution
        without the "if block" performed better, but it
        isn't that relevant, cause this method is intended
        to not be repeated so much in a short amount of
        time, so the results with a small number of
        repetitions are assumed to be more useful.

        This needs further investigation, but it shall be
        postponed for a number of reasons:

        1) Counter-intuitive as they may be, the numbers
           still indicate we should keep the "if block";
        2) I don't know enough of Python internals to be
           able to effectively understand why the results
           were like so;
        3) Though speed is important, I have more urgent
           and important tasks to which to attend;
        4) I need a more systematic way to profile code,
           store the results and manage the resulting
           knowledge, so that the profiling experiments
           I run occasionally all contribute together to
           understand profilling and keeping my code as
           quick as it can be without sacrificing
           maintainability/readability; (though in a way,
           this point is related to the point 2).
        """
        if self.text_settings == text_settings:
            return

        self.image = TEXT_SURFS_DB[text_settings]["surf_map"][self.text]

        self.text_settings = text_settings
Change text settings and replace surface.

        Only does so if the given text settings are
        different than the ones in use.

        Profiling note
        ==============

        I measured the speed of this method both with and
        without the "if block" in a context where the text
        settings were constantly changed between different
        settings. We did so by decorating this method with
        appcommon.debug.measure_average_speed function. We
        used 4, 100, 1000, and 10000 repetitions.

        It turned out, unexpectedly so, that the solution
        with the "if block" made the method quicker when
        the number of repetitions where 4, 100, 1000. The
        speed was about 10% faster.

        We expected all experiments to yield results
        favorable to the solution without the "if block",
        since we know every time the "if check" was
        performed, it came out negative and ended up
        executing the rest of the method anyway, so it
        was just an unnecessary step.

        Only when the repetitions were 10000 the solution
        without the "if block" performed better, but it
        isn't that relevant, cause this method is intended
        to not be repeated so much in a short amount of
        time, so the results with a small number of
        repetitions are assumed to be more useful.

        This needs further investigation, but it shall be
        postponed for a number of reasons:

        1) Counter-intuitive as they may be, the numbers
           still indicate we should keep the "if block";
        2) I don't know enough of Python internals to be
           able to effectively understand why the results
           were like so;
        3) Though speed is important, I have more urgent
           and important tasks to which to attend;
        4) I need a more systematic way to profile code,
           store the results and manage the resulting
           knowledge, so that the profiling experiments
           I run occasionally all contribute together to
           understand profilling and keeping my code as
           quick as it can be without sacrificing
           maintainability/readability; (though in a way,
           this point is related to the point 2).
        
nodezator/textman/cache.py