Try some things: (a) fewer allocations - parse context pool; lexer string pool (b) SWAR process multiple chars at once in keywords/enums/strs/stc.

This commit is contained in:
Thomas Krijnen
2026-03-27 20:45:13 +01:00
parent fe6e9d86ae
commit 603cedc487
14 changed files with 1266 additions and 860 deletions
+7 -4
View File
@@ -39,10 +39,12 @@ IFC_PARSE_API std::u32string convert_utf8(const std::string& string);
namespace IfcParse {
template <typename Reader>
class IFC_PARSE_API IfcCharacterDecoder {
private:
IfcParse::FileReader* stream_;
Reader* stream_;
int codepage_;
std::u32string builder_;
public:
enum ConversionMode {
@@ -50,9 +52,10 @@ class IFC_PARSE_API IfcCharacterDecoder {
UTF8,
ESCAPE
};
static ConversionMode mode;
static char substitution_character;
IfcCharacterDecoder(IfcParse::FileReader* stream);
inline static ConversionMode mode = UTF8;
inline static char substitution_character = '_';
IfcCharacterDecoder(Reader* stream);
~IfcCharacterDecoder();
// Gets a decoded string representation at the token stream
// read pointer and advances the underlying token stream.