Skip to content
Snippets Groups Projects
  1. Jun 29, 2023
    • David Fifield's avatar
      a00d4504
    • David Fifield's avatar
      Specialize ClientMap for ClientID, not generic net.Addr. · c3f2e388
      David Fifield authored
      In practice, we only ever use ClientMap with ClientID. This
      specializiation enables better optimization of this frequently called
      function.
      
      Before:
      ```
      snowflake/common/turbotunnel$ go test -bench BenchmarkSendQueue -benchtime 10s -run '$^' -v
      goos: linux
      goarch: amd64
      pkg: gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel
      cpu: Intel(R) Core(TM) i5 CPU         680  @ 3.60GHz
      BenchmarkSendQueue
      BenchmarkSendQueue-4    100000000              155.4 ns/op
      PASS
      ok      gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel  15.661s
      ```
      
      After:
      ```
      snowflake/common/turbotunnel$ go test -bench BenchmarkSendQueue -benchtime 10s -run '$^' -v
      goos: linux
      goarch: amd64
      pkg: gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel
      cpu: Intel(R) Core(TM) i5 CPU         680  @ 3.60GHz
      BenchmarkSendQueue
      BenchmarkSendQueue-4    176652633               65.69 ns/op
      PASS
      ok      gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel  18.473s
      ```
      c3f2e388
    • David Fifield's avatar
      Close temporary UDPSession in TestQueuePacketConnWriteToKCP. · 58c3121c
      David Fifield authored
      With these not being closed, they were continuing to consume resources
      after the return of the test function, which was affecting the later
      BenchmarkSendQueue.
      
      Before:
      ```
      snowflake/common/turbotunnel$ go test -bench BenchmarkSendQueue -v
      === RUN   TestQueueIncomingOversize
      --- PASS: TestQueueIncomingOversize (0.00s)
      === RUN   TestWriteToOversize
      --- PASS: TestWriteToOversize (0.00s)
      === RUN   TestRestoreMTU
      --- PASS: TestRestoreMTU (0.00s)
      === RUN   TestRestoreCap
      --- PASS: TestRestoreCap (0.00s)
      === RUN   TestQueuePacketConnWriteToKCP
      --- PASS: TestQueuePacketConnWriteToKCP (1.01s)
      goos: linux
      goarch: amd64
      pkg: gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel
      cpu: Intel(R) Core(TM) i5 CPU         680  @ 3.60GHz
      BenchmarkSendQueue
      BenchmarkSendQueue-4     8519708               136.0 ns/op
      PASS
      ok      gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel  3.481s
      ```
      
      After:
      ```
      snowflake/common/turbotunnel$ go test -bench BenchmarkSendQueue -v
      === RUN   TestQueueIncomingOversize
      --- PASS: TestQueueIncomingOversize (0.00s)
      === RUN   TestWriteToOversize
      --- PASS: TestWriteToOversize (0.00s)
      === RUN   TestRestoreMTU
      --- PASS: TestRestoreMTU (0.00s)
      === RUN   TestRestoreCap
      --- PASS: TestRestoreCap (0.00s)
      === RUN   TestQueuePacketConnWriteToKCP
      --- PASS: TestQueuePacketConnWriteToKCP (1.02s)
      goos: linux
      goarch: amd64
      pkg: gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel
      cpu: Intel(R) Core(TM) i5 CPU         680  @ 3.60GHz
      BenchmarkSendQueue
      BenchmarkSendQueue-4    11620237               105.7 ns/op
      PASS
      ok      gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/turbotunnel  3.244s
      ```
      58c3121c
    • David Fifield's avatar
      80980a3a
  2. Jun 20, 2023
  3. Jun 19, 2023
  4. Jun 14, 2023
  5. Jun 08, 2023
  6. May 31, 2023
  7. May 29, 2023
  8. Apr 20, 2023
    • David Fifield's avatar
      Add a scanner error check to ClusterCounter.Count. · 8e5ea826
      David Fifield authored
      It was silently exiting at the "recordingStart":"2022-09-23T17:06:59.680537075Z"
      line, the first line whose length (66873) exceeds
      bufio.MaxScanTokenSize. Now distinctcounter exits with an error status
      instead of reporting partial results.
      
      $ ./distinctcounter -from 2023-01-01T00:00:00Z -to 2023-01-10T00:00:00Z -in metrics-ip-salted.jsonl
      2023/04/20 13:54:11 unable to count:bufio.Scanner: token too long
      8e5ea826
    • meskio's avatar
      Merge remote-tracking branch 'gitlab/main' · f723cf52
      meskio authored
      Verified
      f723cf52
  9. Apr 19, 2023
  10. Apr 05, 2023
  11. Apr 03, 2023
  12. Mar 29, 2023
  13. Mar 22, 2023
  14. Mar 14, 2023
  15. Mar 13, 2023
  16. Mar 10, 2023
  17. Feb 09, 2023
  18. Jan 30, 2023
  19. Jan 19, 2023
  20. Jan 18, 2023
Loading