Skip to content

Instantly share code, notes, and snippets.

@omaskery
omaskery / example_output_windows.txt
Last active February 4, 2021 00:45
Investigating slowness of golang/go executable on Windows?
NOTE: pathext contains 11 extensions
NOTE: path has 50 entries
goos: windows
goarch: amd64
pkg: golang-exec-slow-testbed
BenchmarkBuiltinUnknownCommand
BenchmarkBuiltinUnknownCommand-12 3 398999967 ns/op
BenchmarkBuiltinKnownCommand
BenchmarkBuiltinKnownCommand-12 218 5467874 ns/op
BenchmarkLocalCopyWithUnknownCommand
@omaskery
omaskery / entity_path.rs
Created July 30, 2024 20:33
A failed experiment in creating a suped-up `EntityPath` alternative whose aim was to improve ergonomics of wiring up UI behaviour in Bevy, supposing some future BSN-like proposal improves the ergonomics of instantiating a widget hierarchy.
use std::cmp::Ordering;
use std::fmt::Debug;
use std::str::FromStr;
use bevy::ecs::component::ComponentId;
use bevy::ecs::system::{EntityCommands, IntoObserverSystem};
use bevy::prelude::*;
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct EntityPath {
parts: Vec<EntityPathPart>,
@omaskery
omaskery / main.rs
Created August 28, 2024 20:00
Bevy BSN parse test to learn the nom crate
use nom::{InputLength, IResult, Parser};
use nom::branch::alt;
use nom::bytes::complete::escaped;
use nom::character::complete::{alpha1, alphanumeric1, anychar, digit1, multispace0, one_of};
use nom::combinator::{cut, map, not, opt, peek, recognize};
use nom::error::{context, ContextError, ParseError};
use nom::multi::{many0, many0_count, separated_list0};
use nom::number::complete::double;
use nom::sequence::{delimited, pair, preceded, terminated, tuple};
use nom_locate::LocatedSpan;