Merge: Optimized use of escape_to_c
authorJean Privat <jean@pryen.org>
Fri, 4 Sep 2015 03:33:35 +0000 (23:33 -0400)
committerJean Privat <jean@pryen.org>
Fri, 4 Sep 2015 03:33:35 +0000 (23:33 -0400)
commit938373216463aa2820bb039dc36f827361fd3c64
treeeff9f4e3b90c76f189dcb7b456cce561ab818983
parent8c0f2bff984b8b1cbf567fe8fa2eebbaf65e889d
parent327ad3db8ae52267c272e5993393b786530c7bf4
Merge: Optimized use of escape_to_c

All is in the title, @privat noticed me this morning that text::escape_to_c was taking around 4% of the time in nitc, taking the runtime to 15.183 GIr according to Valgrind.

By shortcutting all Unicode-related services since the C-side escaping is done on ASCII-sequences only and UTF-8 cannot contain invalid C sequences, the gain is substantial, one run of nitc is now done in 14.580 GIr, a gain of 600+ MIr (around 4%, what a coincidence !).

Pull-Request: #1685
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
lib/core/text/flat.nit