Closed tomara-x closed 9 months ago
comparing 1G, 1-char string slices took 19218ms
let now = Instant::now();
let x: &str = "i";
for _ in 0..1_000_000_000 {
if x == "h" {}
}
println!("{}", now.elapsed().as_millis());
comparing 1G i32's took 6489ms
let now = Instant::now();
let x = 1;
for _ in 0..1_000_000_000 {
if x == 2 {}
}
println!("{}", now.elapsed().as_millis());
idk about this
or a counter offer.. use a bimap for each, then a op_to_string/op_from_str (same for lt) so on the inside they're numbers, and the mapping is only in one place..
will this ever be an issue tho? like suppose you used strings, the process function needs to do: number of entities in the queue
+ number of holes
comparisons each frame
so suppose a patch with 10000 entities (ridiculous) with (50000) connections.. lol that takes less than one millisecond
this would free up the o/p/,/. keys, and allow direct sitting of link types and ops (in a way that makes sense!)
maybe use o and l for the commands (and yeet the :set op
command)
return-terminated, and only check that they start with the letter, and remove it and set the op/lt to the rest
for ops it's nice, for link types.. holy poly!
half-done half-not-planned
this is avoided since most of the ops only name networks being set in commands. so ops as strings are good
letters would be way easier to understand amy! and makes switching easier!