Skip to content

Conversation

@dmgcodevil
Copy link
Owner

No description provided.

const size_t byte_index = field_index / 8;
const size_t bit_index = field_index % 8;
inline void set_field_bit(char* base, size_t idx, bool is_set) {
auto words = reinterpret_cast<uint64_t*>(base);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better than byte per field

@dmgcodevil
Copy link
Owner Author

use llvm ADT. use 64 bit word to track fields emty state. precalc fully qualified field names before populate_rows.
use packed 64 int instead of schema + node_id. take 16 bits from schema alias : FNV-1a 32-bit → 16-bit (deterministic, cheap). then use low 48 bit from node_id.

const uint64_t id =
              (static_cast<uint64_t>(schema_id16) << 48) |
              (static_cast<uint64_t>(node_id) & NODE_MASK)

@dmgcodevil
Copy link
Owner Author

before:

duration_optimized=13615 ms

after:
duration_optimized=11262 ms

2353ms faster

@dmgcodevil dmgcodevil closed this Sep 16, 2025
@dmgcodevil dmgcodevil reopened this Sep 16, 2025
@dmgcodevil dmgcodevil merged commit 47259ae into main Sep 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants