tomara-x / quartz

visual programming and dsp playground
https://codeberg.org/tomara-x/quartz
Apache License 2.0
90 stars 3 forks source link

use str link types and ops #30

Closed tomara-x closed 9 months ago

tomara-x commented 9 months ago

letters would be way easier to understand amy! and makes switching easier!

tomara-x commented 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

tomara-x commented 9 months ago

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..

tomara-x commented 9 months ago

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

tomara-x commented 9 months ago

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

tomara-x commented 9 months ago

for ops it's nice, for link types.. holy poly!

tomara-x commented 9 months ago

half-done half-not-planned

tomara-x commented 8 months ago

this is avoided since most of the ops only name networks being set in commands. so ops as strings are good