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
+4 -3
View File
@@ -48,9 +48,10 @@ extern const char *IFCOPENSHELL_VERSION;
namespace IfcParse {
/// A stream of tokens to be read from a FileReader.
template <typename Reader>
class IFC_PARSE_API IfcSpfLexer {
private:
IfcCharacterDecoder* decoder_;
IfcCharacterDecoder<Reader>* decoder_;
size_t skipWhitespace() const;
size_t skipComment() const;
@@ -68,9 +69,9 @@ class IFC_PARSE_API IfcSpfLexer {
}
}
FileReader* stream;
Reader* stream;
// IfcFile* file;
IfcSpfLexer(FileReader* stream);
IfcSpfLexer(Reader* stream);
Token Next();
~IfcSpfLexer();
// void TokenString(size_t offset, std::string& result);