jsoncomparison

package
v0.0.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 0 Imported by: 0

README

JSON Comparison Benchmark

Este directorio contiene benchmarks para comparar el rendimiento de operaciones JSON entre la biblioteca estándar de Go (encoding/json) y TinyString.

Estructura

  • data.go: Contiene las estructuras de datos y funciones de generación de datos de prueba
  • main_test.go: Benchmarks principales para operaciones de Marshal y Unmarshal
  • errors_test.go: Benchmarks específicos para casos de error

Ejecución

Para ejecutar los benchmarks:

go test -bench=. -benchmem

Para un benchmark específico:

go test -bench=BenchmarkJsonMarshalSingle -benchmem

Casos de Prueba

  1. Marshal (Encoding)

    • Objeto individual
    • Lotes de 100, 1000, y 10000 objetos
    • Casos de error
  2. Unmarshal (Decoding)

    • Objeto individual
    • Lotes de 100, 1000, y 10000 objetos
    • Casos de error
  3. Casos de Error

    • JSON mal formado
    • Tipos incorrectos
    • Valores nulos inesperados
    • JSON truncado
    • Estructuras incompletas

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComplexAddress

type ComplexAddress struct {
	ID          string
	Type        string
	Street      string
	Street2     string
	City        string
	State       string
	Country     string
	PostalCode  string
	Coordinates *ComplexCoordinates
	IsPrimary   bool
	IsVerified  bool
}

type ComplexCoordinates

type ComplexCoordinates struct {
	Latitude  float64
	Longitude float64
	Accuracy  int
}

type ComplexNotificationPrefs

type ComplexNotificationPrefs struct {
	Email     bool
	SMS       bool
	Push      bool
	InApp     bool
	Marketing bool
}

type ComplexPhoneNumber

type ComplexPhoneNumber struct {
	ID         string
	Type       string
	Number     string
	Extension  string
	IsPrimary  bool
	IsVerified bool
}

type ComplexPreferences

type ComplexPreferences struct {
	Language      string
	Timezone      string
	Theme         string
	Currency      string
	DateFormat    string
	TimeFormat    string
	Notifications ComplexNotificationPrefs
	Privacy       ComplexPrivacySettings
	Features      Features
}

type ComplexPrivacySettings

type ComplexPrivacySettings struct {
	ProfileVisibility string
	ShowEmail         bool
	ShowPhone         bool
	AllowMessaging    bool
	BlockedUsers      []string
}

type ComplexProfile

type ComplexProfile struct {
	FirstName    string
	LastName     string
	DisplayName  string
	Bio          string
	AvatarURL    string
	BirthDate    string
	PhoneNumbers []ComplexPhoneNumber
	Addresses    []ComplexAddress
	SocialLinks  []ComplexSocialLink
	Preferences  ComplexPreferences
	CustomFields CustomFields
}
type ComplexSocialLink struct {
	Platform string
	URL      string
	Username string
	Verified bool
}

type ComplexStats

type ComplexStats struct {
	LoginCount       int64
	LastActivity     string
	SessionDuration  int64
	PageViews        int64
	ActionsCount     int64
	SubscriptionTier string
	StorageUsed      int64
	BandwidthUsed    int64
}

type ComplexUser

type ComplexUser struct {
	ID          string
	Username    string
	Email       string
	CreatedAt   string
	LastLogin   string
	IsActive    bool
	Profile     ComplexProfile
	Permissions []string
	Metadata    Metadata
	Stats       ComplexStats
}

type CustomFields

type CustomFields struct {
	EmployeeID string
	Department string
	Team       string
}

type Features

type Features struct {
	BetaFeatures   bool
	Analytics      bool
	AdvancedSearch bool
}

type Metadata

type Metadata struct {
	Source      string
	Campaign    string
	Referrer    string
	Experiments []string
	Score       float64
}

Estructuras y datos de prueba para los benchmarks

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL