Files
lux/benchmarks/list_ops.rs
Brandon Lucas 2960dd6538 feat: add benchmarks and enhance LSP completions/hover
Benchmarks:
- Add fib, list_ops, primes benchmarks comparing Lux vs Node.js vs Rust
- Lux matches Rust performance and is 8-30x faster than Node.js
- Add docs/benchmarks.md documenting results

LSP improvements:
- Context-aware completions (module access vs general)
- Add List, String, Option, Result, Console, Math method completions
- Add type and builtin completions
- Hover now shows type signatures and documentation for known symbols
- Hover returns formatted markdown with code blocks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 15:23:35 -05:00

17 lines
435 B
Rust

// List operations benchmark
fn main() {
// Create vec of 10000 numbers
let nums: Vec<i64> = (1..=10000).collect();
// Map: double each number
let doubled: Vec<i64> = nums.iter().map(|x| x * 2).collect();
// Filter: keep even numbers
let evens: Vec<i64> = doubled.iter().filter(|x| *x % 4 == 0).cloned().collect();
// Fold: sum all
let sum: i64 = evens.iter().sum();
println!("Sum: {}", sum);
}