Skip to content

Best Practices

Groundbreaking edited this page Aug 29, 2025 · 1 revision

Best Practices

When to Use Fission

  • ✅ Text parsing and processing
  • ✅ Large file streaming
  • ✅ Performance-critical applications
  • ✅ Custom format parsing

When to Use Standard APIs

  • ✅ Simple file reading (Files.readString())
  • ✅ Basic line processing (Files.readAllLines())
  • ✅ Thread-safe requirements

Performance Tips

  • Use readWhile() instead of manual loops
  • Leverage peekAhead() for pattern matching
  • Use mark()/reset() sparingly (has cost)
  • Close FileCharSource with try-with-resources

Clone this wiki locally