This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Prefabs { | |
static Entity SpawnEnemy(Vec2I pos, EnemyType enemyType) { | |
Entity entt = PrepEnemyCommon(pos); | |
switch (enemyType) { | |
case EnemyType.Skeleton: | |
entt.Add( | |
new EntityName { value = "Skeleton" }, | |
new TextureWithSource(Assets.monsterTexture) { | |
TileIdx = new Vec2I(0, 4) | |
}, |
Benchmarking different ways to dispatch to a trait method, using static dispatch (compile time polymorphism), dynamic dispatch (runtime polymorphism) and dynamic dispatch backed by an arena allocator.
cargo.toml
[dependencies]
bumpalo = "3.13.0"
criterion = "0.5.1"
[[bench]]
name = "my_benchmark"
npm command | Yarn command | pnpm equivalent | bun equivalent |
---|---|---|---|
npm install | yarn | pnpm install | bun install |
npm install [pkg] | yarn add [pkg] | pnpm add [pkg] | bun add [pkg] |
npm uninstall [pkg] | yarn remove [pkg] | pnpm remove [pkg] | bun remove [pkg] |
npm update | yarn upgrade | pnpm update | bun update |
npm list | yarn list | pnpm list | ? |
npm run [scriptName] | yarn [scriptName] | pnpm [scriptName] | bun run [scriptName] |
npx [command] | yarn dlx [command] | pnpm dlx [command] | bunx [command] |
npm exec | yarn exec [c |
These have an interactive configuration similar to Vite, allowing you to select the framework (Vue, React, etc.)
https://vite-plugin-web-extension.aklinker1.io/
- Vite: with initializer
- Chrome and Firefox
- Newer, works nicely, dev loads extension into separate browser profile