Skip to content

schroedermarius/ToonBenchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ToonBenchmark

A C# benchmarking tool that compares data serialization formats (JSON vs. TOON) when interacting with OpenAI's language models.

Overview

ToonBenchmark evaluates the efficiency of different data serialization formats by measuring token usage and response times when sending employee data to OpenAI's GPT model for analysis. The tool compares:

  • JSON: Traditional JSON serialization
  • TOON: ToonSharp serialization format

Features

  • 📊 Benchmark JSON vs. TOON serialization formats
  • 🤖 Integration with OpenAI's GPT models
  • 📈 Detailed performance metrics (tokens, duration)
  • 🎨 Beautiful console output using Spectre.Console
  • 📝 Sample dataset with 200 employee records

Prerequisites

  • .NET 9.0 SDK
  • OpenAI API key

Installation

  1. Clone the repository
  2. Restore dependencies:
    dotnet restore

Usage

  1. Run the application:

    dotnet run
  2. Enter your OpenAI API key when prompted

  3. The tool will:

    • Load employee data from data.json
    • Send the data in JSON format to OpenAI
    • Send the same data in TOON format to OpenAI
    • Display comparison metrics

Data Format

The data.json file contains employee records with the following structure:

{
  "id": 1,
  "name": "Alice",
  "department": "Engineering",
  "salary": 120000
}

Metrics

The benchmark measures:

  • Prompt Tokens: Number of input tokens sent
  • Completion Tokens: Number of tokens in the response
  • Duration: Time taken for the API call

Dependencies

License

This project is intended for benchmarking and educational purposes.

Contributing

Feel free to open issues or submit pull requests for improvements.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages