Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sttp/goapi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: PingThingsIO/goapi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 14 files changed
  • 2 contributors

Commits on Dec 3, 2024

  1. CompactMeasurements: add publishing API, optimize (#11)

    * CompactMeasurement: simplify, optimize, and add DataPublisher support
    
    * CompactMeasurement: expose SignalIndex and Flags for DataPublisher use
    
    * restore
    
    * go fmt
    
    ---------
    
    Co-authored-by: Noam Preil <[email protected]>
    pixelherodev and Noam Preil authored Dec 3, 2024
    Configuration menu
    Copy the full SHA
    85c4c15 View commit details
    Browse the repository at this point in the history
  2. DataTable: add optimized apis (#9)

    * datacolumn: drop unnecessary/unidiomatic getter for DataColumn.Computed
    
    * datarow: add faster mechanism for retrieving values
    
    * datatable: expose rows for faster/easier iteration
    
    ---------
    
    Co-authored-by: Noam Preil <[email protected]>
    pixelherodev and Noam Preil authored Dec 3, 2024
    Configuration menu
    Copy the full SHA
    7c96572 View commit details
    Browse the repository at this point in the history
  3. datasubscriber: pool measurement buffers (#10)

    * DataSubscriber: use a Pool for measurement allocations
    
    Requires the subscriber to return slices to the pool when done in order
    to work...
    
    * DataSubscriber: store pointers to buffers in pool
    
    Slice headers are three words; storing []T in a pool results in
    allocations on pool.Get(), since the slice will escape into the
    callback.
    
    By storing a pointer to the slice header, and passing that around, we
    only need to allocate the slice header on construction of a new slice.
    
    * DataSubscriber: initialize measurement packets to needed size
    
    * Change MeasurementsCallback API to take *Measurements
    
    ---------
    
    Co-authored-by: Noam Preil <[email protected]>
    pixelherodev and Noam Preil authored Dec 3, 2024
    Configuration menu
    Copy the full SHA
    7426a64 View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2024

  1. Tick cleanup (#12)

    * subscriber: switch from ToTime(ticks) to ticks.ToTime() API
    
    Using the member function is more idiomatic; having two identical APIs
    is redundant and ideally we should drop the secondary one.
    
    * ticks: Drop redundant explanation
    
    The explanation is not sufficient for those not versed in time standards
    and not necessary for those who are; the comment does not really help.
    
    * ticks: add ticks.FromUnixNs() conversion function
    
    Bypasses using time.Time as an intermediary, reducing a source of
    per-point overhead.
    
    * ticks: switch FromTime() to use FromUnixNs()
    
    FromTime() conversion already works by converting to unix nanoseconds
    first, and then to Ticks; just reuse the FromUnixNs() function instead
    of implementing twice.
    
    * ticks: have Ticks.ToTime() implement logic directly
    
    The member function is more idiomatic; it should implement logic
    directly instead of relying upon a secondary implementation.
    
    Ideally, the secondary API should be dropped.
    
    * ticks: add Ticks.ToUnixNs() function
    
    Similar to FromUnixNs(), bypassing intermediate time.Time conversion
    reduces necessary computation and stack usage, and potentially
    allocations?
    
    I've verified that this improves (reduces) CPU utilization, with user
    code switched to use this API.
    
    * ticks: document that leap seconds are discarded upon format conversion
    
    Converting from ticks to time.Time or nanoseconds is an inherently lossy
    operation!
    
    * ticks: expose leap second APIs as part of the Ticks interface
    
    This should ideally replace the existing ticks.*LeapSecond* functions,
    so that we don't have some functions as fn(Ticks) and others as
    Ticks.fn()
    
    * ticks: rename from UnixNs to UnixNano for consistency with Time
    
    * ticks: test unix timestamp conversion
    
    * switch from ToTime(ticks) to ticks.ToTime()
    
    * ticks: update modification history
    
    * Fix MaxTicks comment
    
    * fix whitespace
    
    * fix nano usage
    
    ---------
    
    Co-authored-by: Noam Preil <[email protected]>
    pixelherodev and Noam Preil authored Dec 31, 2024
    Configuration menu
    Copy the full SHA
    9700577 View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2025

  1. guid.Equal(): add benchmarking, improve performance by 100x (#13)

    * guid: use bytes.Equal for equality testing
    
    Instead of looping over each byte and checking, bytes.Equal uses string
    conversion and equality testing, which should use compiler intrinsics.
    
    * guid: optimize Components() call, clean up code
    
    * guid: minor simplification
    
    * guid: swap Equals() to integer comparisons instead of strings
    
    * guid: clean up test
    
    * guid: add benchmark for Equals()
    
    * update benchmark, further improve performance
    
    * guid: add benchmark of direct == (Thanks Jorge!)
    
    * guid: kill indirection, use == operator for Equal()
    
    This just... works. And is slightly faster than unsafe conversion, too.
    
    ---------
    
    Co-authored-by: Noam Preil <[email protected]>
    pixelherodev and Noam Preil authored Jan 9, 2025
    Configuration menu
    Copy the full SHA
    39e851a View commit details
    Browse the repository at this point in the history
Loading