rage-iodine 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51d87d746e9c30552afbb177d23f52600d6b39668596921d396573cafb2296fc
4
- data.tar.gz: 8f30fe5b42df456d0322712155ebada9c71c6c71f82748bd49d424ba2ad34707
3
+ metadata.gz: 9ef6e88ecbc5910815537ef78329c6bc965261fb4514c479be7594fb6de61dca
4
+ data.tar.gz: '09632895e2ed3a00f6300a418c46b7f10332403f83aceeaffe77af57258f9baf'
5
5
  SHA512:
6
- metadata.gz: 71cd1ec57ac2ea2680e4953207a7cbb2541b76e3eab7ce148ec06ab782079d056abb18a15fcbee8c62f6d1c6300ccce4a6951632e7c5b61f4ecac51deb8a8f05
7
- data.tar.gz: 9c9091274cdecc5feff09ba84957162cfc466b4261eea2f74bf57bcd17ffeae05215b4f791d0250736828b04144e204367e64c6527bf189dabe23b39125fe6ab
6
+ metadata.gz: 6ce3edb67d9029b9a9bf73a941dcbcd7378214246cbbb5a09084f085dda5c2b41003dc75338a595f054e28db146cc713e887a3d43fffebefc80567d87348a94a
7
+ data.tar.gz: 3b2f347ecc8732f23ecac55bbc5c8c3d9d51b6e814bbb9b87f23d538f211ab6a605972b879f4449c3ce10fe95bc1920930304e604f53f5f593d5d889f4095c25
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ Please notice that this change log contains changes for upcoming releases as wel
6
6
 
7
7
  ## Changes:
8
8
 
9
+ #### Change log v.5.4.0 (2026-06-08)
10
+
11
+ **Update**: Optimize `fio_run_every` timers
12
+
9
13
  #### Change log v.5.3.0 (2026-06-03)
10
14
 
11
15
  **Update**: Add Iodine::WorkerPool
data/ext/iodine/fio.c CHANGED
@@ -1473,6 +1473,10 @@ static fio_ls_embd_s fio_timers = FIO_LS_INIT(fio_timers);
1473
1473
 
1474
1474
  static fio_lock_i fio_timer_lock = FIO_LOCK_INIT;
1475
1475
 
1476
+ #ifndef FIO_TIMER_TAIL_PROBE_LIMIT
1477
+ #define FIO_TIMER_TAIL_PROBE_LIMIT 16
1478
+ #endif
1479
+
1476
1480
  /** Marks the current time as facil.io's cycle time */
1477
1481
  static inline void fio_mark_time(void) {
1478
1482
  clock_gettime(CLOCK_REALTIME, &fio_data->last_cycle);
@@ -1538,6 +1542,33 @@ static void fio_timer_add_order(fio_timer_s *timer) {
1538
1542
  timer->due = fio_timer_calc_due(timer->interval);
1539
1543
  // fio_ls_embd_s *pos = &fio_timers;
1540
1544
  fio_lock(&fio_timer_lock);
1545
+
1546
+ if (!fio_ls_embd_any(&fio_timers)) {
1547
+ fio_ls_embd_push(&fio_timers, &timer->node);
1548
+ goto finish;
1549
+ }
1550
+
1551
+ fio_timer_s *tail = FIO_LS_EMBD_OBJ(fio_timer_s, node, fio_timers.prev);
1552
+ if (fio_timer_compare(timer->due, tail->due) <= 0) {
1553
+ fio_ls_embd_push(&fio_timers, &timer->node);
1554
+ goto finish;
1555
+ }
1556
+
1557
+ fio_timer_s *head = FIO_LS_EMBD_OBJ(fio_timer_s, node, fio_timers.next);
1558
+ if (fio_timer_compare(timer->due, head->due) >= 0) {
1559
+ fio_ls_embd_push(fio_timers.next, &timer->node);
1560
+ goto finish;
1561
+ }
1562
+
1563
+ fio_ls_embd_s *node = fio_timers.prev;
1564
+ for (size_t i = 0; i < FIO_TIMER_TAIL_PROBE_LIMIT && node != &fio_timers; ++i, node = node->prev) {
1565
+ fio_timer_s *t2 = FIO_LS_EMBD_OBJ(fio_timer_s, node, node);
1566
+ if (fio_timer_compare(t2->due, timer->due) >= 0) {
1567
+ fio_ls_embd_push(node->next, &timer->node);
1568
+ goto finish;
1569
+ }
1570
+ }
1571
+
1541
1572
  FIO_LS_EMBD_FOR(&fio_timers, node) {
1542
1573
  fio_timer_s *t2 = FIO_LS_EMBD_OBJ(fio_timer_s, node, node);
1543
1574
  if (fio_timer_compare(timer->due, t2->due) >= 0) {
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '5.3.0'.freeze
2
+ VERSION = '5.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rage-iodine
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
@@ -122,7 +122,6 @@ extra_rdoc_files: []
122
122
  files:
123
123
  - ".github/ISSUE_TEMPLATE/bug_report.md"
124
124
  - ".github/workflows/release.yml"
125
- - ".github/workflows/ruby.yml"
126
125
  - ".gitignore"
127
126
  - ".rspec"
128
127
  - ".yardopts"
@@ -1,42 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support documentation.
4
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
5
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
6
-
7
- name: Building iodine
8
-
9
- on:
10
- push:
11
- branches: [ "master" ]
12
- pull_request:
13
- branches: [ "master" ]
14
-
15
- permissions:
16
- contents: read
17
-
18
- jobs:
19
- test:
20
- strategy:
21
- fail-fast: false
22
- matrix:
23
- ruby-version: ['2.3', '2.7', '3.0', '3.1', '3.2']
24
- os: [ubuntu-latest, macos-latest] # , windows-latest
25
- runs-on: ${{ matrix.os }}
26
- steps:
27
- - uses: actions/checkout@v3
28
- - name: Set up Ruby # see https://github.com/ruby/setup-ruby#versioning)
29
- uses: ruby/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby-version }}
32
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
- - name: Build and Test Iodine
34
- run: |
35
- echo CFLAGS = $CFLAGS
36
- echo cflags = $cflags
37
- echo HOME = $HOME
38
- ruby -e 'puts Gem.default_dir'
39
- bundle exec rake install
40
- # env VERBOSE=1 bundle exec rspec --format documentation
41
- # - name: Run tests
42
- # run: bundle exec rake